-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuild.fs
More file actions
43 lines (32 loc) · 1.09 KB
/
Copy pathBuild.fs
File metadata and controls
43 lines (32 loc) · 1.09 KB
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
open Fake.Core
open Fake.IO
open Fake.Core
open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
[<Literal>]
let here = __SOURCE_DIRECTORY__
let initializeContext () =
let execContext = Context.FakeExecutionContext.Create false "build.fsx" []
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)
let runProc cmd path args =
CreateProcess.fromRawCommand cmd args
|> CreateProcess.withWorkingDirectory path
|> Proc.run // start with the above configuration
|> ignore // ignore exit code
let dotnet args path = runProc "dotnet" path args
initializeContext ()
Target.create "Clean" (fun _ -> !! "src/**/bin" ++ "src/**/obj" |> Shell.cleanDirs)
Target.create "Build" (fun _ ->
dotnet [ "build" ] (here </> "fable")
)
Target.create "Test" (fun _ ->
dotnet [ "fable"; "watch"; "-o"; "output"; "-s"; "--run"; "npx"; "vite" ] "fable/tests")
Target.create "Format" (fun _ -> dotnet [ "fantomas"; "." ] ".")
let deps = [
"Clean" ==> "Build" ==> "Test"
]
[<EntryPoint>]
let main args =
Target.runOrDefault "Test"
0