-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.fsx
executable file
·55 lines (43 loc) · 1.32 KB
/
build.fsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env -S dotnet fsi
#r "nuget: Fake.DotNet.Cli, 6.0.0"
#r "nuget: Fake.IO.FileSystem, 6.0.0"
#r "nuget: Fake.Core.Target, 6.0.0"
#r "nuget: Fake.DotNet.MsBuild, 6.0.0"
#r "nuget: MSBuild.StructuredLogger, 2.2.243"
#r "nuget: System.Reactive, 5.0.0"
open System
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
// https://github.com/fsharp/FAKE/issues/2517#issuecomment-727282959
Environment.GetCommandLineArgs()
|> Array.skip 2 // skip fsi.exe; build.fsx
|> Array.toList
|> Context.FakeExecutionContext.Create false "build.fsx"
|> Context.RuntimeContext.Fake
|> Context.setExecutionContext
let output = "./nugets"
let projects =
[| "Bix"
"Bix.Bun"
"Bix.Deno"
"Bix.Cloudflare"
"Templates" |]
Target.initEnvironment ()
Target.create "Clean" (fun _ -> !! "nugets" |> Shell.cleanDirs)
Target.create "PackNugets" (fun _ ->
projects
|> Array.iter (fun project ->
DotNet.pack
(fun opts ->
{ opts with
Configuration = DotNet.BuildConfiguration.Release
OutputPath = Some $"./{output}" })
$"src/{project}"))
Target.create "Default" (fun _ -> Target.runSimple "PackNugets" [] |> ignore)
"Clean"
==> "PackNugets"
==> "Default"
Target.runOrDefault "Default"