Repository navigation
Replies: 1 comment
|
With current just (1.53+), this can be expressed without recursively invoking just by using list-valued conditional dependencies. Lists are currently unstable, so enable them explicitly: For ordinary builds, dispatching inside one recipe is still the clearest solution and avoids a child just process. If build_go/build_rust must remain recipes, current list semantics let a false conditional yield [] and a mapped dependency run zero times. For example: Add an assert/error guard for unknown names if you use that form. The relevant behavior is documented in Lists: a missing else evaluates to [], and mapped dependencies run once per list element. I also verified the shown dependency syntax against current just 1.58.0. On older just versions, use the single shell/shebang recipe above because conditional dependencies were not supported. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I would like to conditionally select a recipe based on argument. For example, I have a list of projects in golang, and a list of projects in rust. I want to build any one of them based on the name of the project.
I want to execute something like:
and have just pick the right recipe. Here is what I tried - a recipe called
buildthat selects the recipe to run (as a dependency) based on the name of the project:Obviously this doesn't work because specifying this type of conditional dependency for
buildis not supported. Is there an recommended way to achieve this, ideally without recursively calling just?All reactions