+
+
+
+
+
build.cs
#!/usr/bin/env -S dotnet run --
#:package Nullean.Runna@0.1.0
@@ -568,6 +586,39 @@ One file.
Then run it.
union Target(Clean, Build, Test);
+
+ A file-based app is enough: build.cs next to your solution, run with dotnet run build.cs
+ or straight from the shell.
+
+
+
build/Program.fs
+
open Nullean.Runna.Fs
+open Proc.Fs
+
+type Target =
+ /// Delete build output
+ | Clean
+ /// Build the solution
+ | Build
+ /// Build, then run the tests
+ | Test
+
+[<EntryPoint>]
+let main argv =
+ let app = RunnaApp<Target>("build", None)
+
+ app.Bind <| function
+ | Clean -> target [] { sh $"dotnet clean" }
+ | Build -> target [Clean] { sh $"dotnet build" }
+ | Test -> target [Build] { sh $"dotnet test" }
+
+ app.RunAsync(argv).GetAwaiter().GetResult()
+
+
+ F# targets live in a small project, say build/build.fsproj with
+ GenerateDocumentationFile on, run with dotnet run --project build --.
+ A case you forget in Bind is a compiler warning.
+
The package READMEs cover the full DSL:
Nullean.Runna for C# and
@@ -620,6 +671,12 @@
runna build.
Ship it.