-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
81 lines (59 loc) · 2.4 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
open System.IO
// --------------------------------------------------------------------------------------
// FAKE build script
// --------------------------------------------------------------------------------------
#I "packages/build/FAKE/tools"
#r "FakeLib.dll"
open Fake
open Fake.YarnHelper
// --------------------------------------------------------------------------------------
// Build the Generator project and run it
// --------------------------------------------------------------------------------------
Target "Clean" (fun _ ->
CleanDir "./temp"
)
Target "YarnInstall" <| fun () ->
Yarn (fun p -> { p with Command = Install Standard })
Target "DotNetRestore" <| fun () ->
DotNetCli.Restore (fun p -> { p with WorkingDir = "src" } )
let releaseBin = "release/bin"
let neptuneBin = "paket-files/github.com/Krzysztof-Cieslak/Neptune/build"
Target "CopyNeptune" (fun _ ->
ensureDirectory releaseBin
CleanDir releaseBin
!! (neptuneBin + "/*")
|> CopyFiles releaseBin
CopyDir (releaseBin </> "runtimes") (neptuneBin </> "runtimes") (fun _ -> true)
)
let releaseVSTestBin = "release/bin_vstest"
let neptuneVSTestBin = "paket-files/github.com/Krzysztof-Cieslak/Neptune-vstest/build"
Target "CopyNeptuneVSTest" (fun _ ->
ensureDirectory releaseVSTestBin
CleanDir releaseVSTestBin
!! (neptuneVSTestBin + "/*")
|> CopyFiles releaseVSTestBin
CopyDir (releaseVSTestBin </> "runtimes") (neptuneVSTestBin </> "runtimes") (fun _ -> true)
)
let runFable additionalArgs =
let path = Path.Combine(__SOURCE_DIRECTORY__, "webpack.config.js")
let cmd = sprintf "fable webpack -- --config %s %s" path additionalArgs
DotNetCli.RunCommand (fun p -> { p with WorkingDir = "src" } ) cmd
Target "RunScript" (fun _ ->
// Ideally we would want a production (minized) build but UglifyJS fail on PerMessageDeflate.js as it contains non-ES6 javascript.
runFable ""
)
Target "Watch" (fun _ ->
runFable "--watch"
)
// --------------------------------------------------------------------------------------
// Run generator by default. Invoke 'build <Target>' to override
// --------------------------------------------------------------------------------------
Target "Default" DoNothing
"YarnInstall" ?=> "RunScript"
"DotNetRestore" ?=> "RunScript"
"Clean"
==> "CopyNeptune"
==> "CopyNeptuneVSTest"
==> "RunScript"
==> "Default"
RunTargetOrDefault "Default"