-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
76 lines (62 loc) · 1.54 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
#r "paket:
nuget Fake.IO.FileSystem
nuget Fake.DotNet.Cli
nuget Fake.JavaScript.Yarn
nuget Fake.Core.Target //"
#load ".fake/build.fsx/intellisense.fsx"
open Fake.Core
open Fake.DotNet
open Fake.IO
open Fake.IO.Globbing.Operators
open Fake.Core.TargetOperators
open Fake.JavaScript
Target.create "Clean" (fun _ ->
!! "src/**/bin"
++ "src/**/obj"
++ "tests/output"
++ "deploy"
|> Shell.cleanDirs
)
let inline withWorkDir wd =
DotNet.Options.withWorkingDirectory wd
Target.create "Restore" (fun _ ->
DotNet.exec (withWorkDir "./src") "restore" ""
|> ignore
)
Target.create "Hack" (fun _ ->
let home = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile)
let matcher = System.IO.Path.Combine(home, ".nuget", "packages", "fable.import.jest", "1.9.0", "fable", "Matchers.fs")
System.IO.File.Copy("./hack/Matchers.fs", matcher, true)
)
let defaultOpts = id
Target.create "YarnInstall" (fun _ ->
Yarn.install defaultOpts
|> ignore
)
Target.create "Build" (fun _ ->
Yarn.exec "run build" defaultOpts
|> ignore
)
Target.create "TestBuild-Jest" (fun _ ->
Yarn.exec "run test-build" defaultOpts
|> ignore
)
Target.create "Test-Jest" (fun _ ->
Yarn.exec "run test" defaultOpts
|> ignore
)
Target.create "Test-dotnet" (fun _ ->
DotNet.exec (withWorkDir "./tests") "run" "--project XmasList.Tests.fsproj"
|> ignore
)
Target.create "All" ignore
"Clean"
==> "Restore"
==> "Hack"
==> "YarnInstall"
==> "Build"
==> "TestBuild-Jest"
==> "Test-Jest"
==> "Test-dotnet"
==> "All"
Target.runOrDefault "All"