Skip to content

Run several targets from one command line, and add --skip - #136

Merged
Mpdreamz merged 25 commits into
mainfrom
make/cli
Nov 12, 2026
Merged

Mpdreamz merged 25 commits into
mainfrom
make/cli

Conversation

@Mpdreamz

@Mpdreamz Mpdreamz commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

A command line can name several targets, build lint test --filter Unit pack, and --skip <target> leaves a target out of the plan.

Prompt summary: The remaining make-like features from the gap list: running several targets in one invocation, and skipping one target rather than every gate.

Why

build test pack treated pack as an argument of test, so the wrappers documented that make test pack starts the script twice. -s skips every gate of the named target; there was no way to drop one target, such as docs, from a release.

What

Several targets

The targets run in the order they are named and share their dependencies. Each takes the arguments up to the next target's name. A word stays with the target before it when it is the value of an option before it, or when that target takes positional arguments; everything after -- stays too. F# still rejects a word for a target without a record.

--skip

--skip docs, or a comma-separated list, accepting pkg generate, pkg/generate and pkg:generate. The plan leaves the target out wherever it appears, with the dependencies only it needed. --graph shows it as skipped: --skip. An unknown name exits 2 with a suggestion; naming a target the command line runs exits 2.

Package skills

The nullean-make and nullean-make-fs skills that ship in the packages describe every feature of this stack.

Verify

dotnet run build.cs -- clean build --graph
dotnet run build.cs -- release --skip test --graph

Stack: 5 of 6, on top of #135; next: #137

🤖 Generated with Claude Code

Mpdreamz and others added 7 commits November 12, 2026 08:25
A dependency such as `Test { Filter = Some "Unit" }` or `new Test("Unit")` ran with the case's defaults in the
union and F# surfaces, and with the named target's own arguments in the class and F# surfaces. Each surface now
hands the planner a target source, and a run is planned as instances: a target and a value. Equal values run
once, different values once each, and only the named target binds the command line. The union app's --version
prints the entry assembly's informational version instead of 0.0.0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`--graph` plans the run as the target would, with its arguments bound, `-s` applied and conditions evaluated,
then draws it and runs nothing. Skipped targets show with the reason. It draws a tree with the run order below
it, a Mermaid flowchart or JSON. A target's help lists the order its dependencies run in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A command declares a stage whose targets run at once: `.Parallel(...)` in C#, `concurrently [...]` in F#,
where `parallel` is reserved. The run starts each target once everything it waits for has finished, up to
`-j` targets at a time. The first failure cancels the targets still running; `-k` lets the ones that do not
depend on it finish. While targets run side by side their output carries their names, or `--output grouped`
writes each target's lines together. Lists keep running in order, so a build without a parallel stage runs as
before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…urface

`OnlyWhen` skips a body, and the union and F# surfaces now have it too. `After` orders a target after another
in the same run without adding it. `Cleanup` runs targets at the end of the run once a target started, even
after a failure. `NeedsEnv` and `NeedsTool` are checked for every target before the first one starts, and the
run lists everything missing. F# pipes a target through `onlyWhen`, `after`, `cleanup`, `needsEnv`, `needsTool`
and `describe`; `describe` gives an .fsx script its descriptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… --skip

`build lint test --filter Unit pack` runs the three targets in order, sharing their dependencies. Each target
takes the arguments up to the next target's name; an option's value and a target's positionals stay with it.
`--skip <target>` leaves a target out of the plan with the dependencies only it needed, and `--graph` shows it
as skipped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mpdreamz and others added 17 commits November 12, 2026 11:51
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	src/Nullean.Make/Execution/DepGraphExecutor.cs
#	src/Nullean.Make/Execution/RunPlan.cs
#	src/Nullean.Make/MakeAppOfT.cs
#	tests/Nullean.Make.Fs.Tests/Nullean.Make.Fs.Tests.fsproj
# Conflicts:
#	docs/_docset.yml
#	docs/make/index.md
#	src/Nullean.Make.Fs/MakeApp.fs
#	src/Nullean.Make/Execution/DepGraphExecutor.cs
#	src/Nullean.Make/Help/MakeHelpPrinter.cs
#	src/Nullean.Make/MakeAppOfT.cs
#	src/Nullean.Make/Parsing/ArgvParser.cs
#	tests/Nullean.Make.Fs.Tests/Nullean.Make.Fs.Tests.fsproj
@Mpdreamz
Mpdreamz changed the base branch from make/modifiers to main November 12, 2026 11:48
Mpdreamz added a commit that referenced this pull request Nov 12, 2026
Every target surface can now skip a body on a condition, run after a
target without depending on it, clean up at the end of a run, and say
which environment variables and tools it needs.

**Prompt summary:** Beyond parallel stages, the Make DSLs should get the
other make- and graph-like features that are missing.

## Why

`OnlyWhen` existed only on the class surface. There was no way to order
two targets without one depending on the other, no cleanup that runs
after a failure, and a missing `NUGET_API_KEY` failed the run at
`publish`, after everything else had run.

## What

#### Conditions
`.OnlyWhen(() => ...)` on the union builder and `|> onlyWhen (fun () ->
...)` in F#, as the class surface already had. The body is skipped; the
dependencies still run.

#### `After`
`.After(new Lint())` / `|> after [Lint]` orders a target after another
one when both are in the run, without adding it. A reference with its
default value matches the other target with any value. An `After` that
contradicts an order the plan already has is a cycle, and the run exits
`1` naming the targets.

#### `Cleanup`
`.Cleanup(new StopDb())` / `|> cleanup [StopDb]` runs targets at the end
of the run once this one started, newest first, each once, even after a
failure. A cleanup runs its body only. The run keeps the failure's exit
code.

#### `NeedsEnv` and `NeedsTool`
Checked for every target the run would start before the first one
starts. The run lists everything missing and exits `1`. `--graph` lists
it under `Missing:`.

#### `describe` for F# scripts
`|> describe "..."` sets a description in the script, for an `.fsx`
without an XML doc file. This addresses
#128 with a pipe function rather
than the forms the issue proposes, so the PR does not close it.

## Verify

```bash
dotnet test --project tests/Nullean.Make.Tests -c Release --treenode-filter "/*/*/*ModifierTests/*"
dotnet test --project tests/Nullean.Make.Fs.Tests -c Release --treenode-filter "/*/*/*ModifierTests*/*"
```

**Stack:** 4 of 6, on top of
[#134](#134); next:
[#136](#136)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@Mpdreamz
Mpdreamz merged commit f6ee58d into main Nov 12, 2026
13 checks passed
@Mpdreamz
Mpdreamz deleted the make/cli branch November 12, 2026 11:52
Mpdreamz added a commit that referenced this pull request Nov 12, 2026
…rappers (#137)

F# `sh` commands in a parallel stage now carry their target's name and
stop when another target fails, and the generated wrappers list the new
run switches.

**Prompt summary:** Close the gaps the earlier PRs left. Breaking the
wrapper output is fine.

## Why

Proc.Fs ran a `target { }` block with a token that could not be
cancelled, so its `sh` commands wrote to the shared console: no target
name on their lines, and a failing sibling did not stop them. The mise
include's `usage` spec did not list `--graph`, `-j`, `-k`, `--output` or
`--skip`, so mise did not complete them.

## What

#### F# `sh` in parallel stages
While targets run side by side, `target { }` runs its block with the
run's cancellation token through Proc.Fs's `ShellBuilder.Run(step,
cancellationToken)`. Its commands then print through `Console.Out`,
where each line gets the target's name, and cancelling stops the running
command. A run without a parallel stage passes no token, so commands
keep the console and its colours. Proc and Proc.Fs move to `0.22.0`.

#### Wrapper switches
The mise include lists the five switches. A build option with the same
short name keeps it, as on the command line.

**Breaking:** committed wrapper files change, so `__wrappers check`
fails until `__wrappers sync` runs once.

**Blocked:** this needs Proc and Proc.Fs `0.22.0`, which
nullean/proc#51 adds. Restore fails until that
is released.

## Verify

```bash
dotnet test --project tests/Nullean.Make.Fs.Tests -c Release --treenode-filter "/*/*/*ParallelShellTests*/*"
dotnet test --project tests/Nullean.Make.Tests -c Release --treenode-filter "/*/*/WrapperTests/*"
```

**Stack:** 6 of 6, on top of
[#136](#136)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature A new capability (minor bump)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant