-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathBuild.fs
72 lines (54 loc) · 1.51 KB
/
Build.fs
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
open Fake.Core
open Fake.IO
open Helpers
initializeContext()
let buildPath = Path.getFullName "build"
let srcPath = Path.getFullName "src"
let deployPath = Path.getFullName "deploy"
let testsPath = Path.getFullName "test"
// Until Fable (beyond) is released, we need to compile with locally installed Fable branch.
let cliPath = Path.getFullName "../Fable/src/Fable.Cli"
Target.create "Clean" (fun _ ->
Shell.cleanDir buildPath
)
Target.create "Build" (fun _ ->
Shell.mkdir buildPath
run dotnet $"fable --lang Python --outDir {buildPath}" srcPath
)
Target.create "Docs" (fun _ ->
run poetry $"run jb build docs-src --path-output {buildPath}/docs" "."
Fake.IO.Shell.copyDir "docs" $"{buildPath}/docs/_build/html" (fun _ -> true)
)
Target.create "Run" (fun _ ->
run dotnet "build" srcPath
)
Target.create "Test" (fun _ ->
run dotnet "build" testsPath
[ "native", dotnet "run" testsPath
"python", dotnet $"fable --lang Python --outDir {buildPath}/tests" testsPath
]
|> runParallel
run poetry $"run pytest {buildPath}/tests" ""
)
Target.create "Pack" (fun _ ->
run dotnet "pack -c Release" srcPath
)
Target.create "Format" (fun _ ->
run dotnet "fantomas . -r" srcPath
run dotnet "fantomas . -r" testsPath
)
open Fake.Core.TargetOperators
let dependencies = [
"Clean"
==> "Build"
"Clean"
==> "Run"
"Build"
==> "Test"
"Build"
==> "Docs"
"Build"
==> "Pack"
]
[<EntryPoint>]
let main args = runOrDefault args