-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
80 lines (64 loc) · 1.88 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
// include Fake libs
#r "./packages/FAKE/tools/FakeLib.dll"
#r @"./packages/FSharpLint/FSharpLint.FAKE.dll"
open Fake
open Fake.Testing
open FSharpLint.FAKE
let buildDir = "./build/"
let testDir = "./test/"
Target "Clean" (fun _ ->
CleanDirs [
buildDir;
"./test/TicTacToe.Test/bin/";
"./test/TicTacToe.Test/obj/"
])
let appReferences =
!! "/**/*.fsproj"
Target "Build" (fun _ ->
let properties a =
[
"Optimize", "True"
"Configuration", "Release"
"NoWarn", "0760"
]
MSBuildWithProjectProperties buildDir "Build" properties appReferences
|> Log "AppBuild-Output: ")
Target "BuildTest" (fun _ ->
let setParams defaults =
{ defaults with
Verbosity = Some MSBuildVerbosity.Quiet
Targets = ["Build"]
Properties =
[
"Optimize", "False"
"DebugSymbols", "True"
"Configuration", "Debug"
"NoWarn", "0760"
]
}
build setParams "test/TicTacToe.Test/TicTacToe.Test.fsproj" |> DoNothing)
let nunitSetParams where defaults =
{ defaults with
Where = where
ShadowCopy = true;
Labels = LabelsLevel.All;
ToolPath = "packages/NUnit.ConsoleRunner/tools/nunit3-console.exe" }
Target "Test" (fun _ ->
!! (testDir + "/**/bin/Debug/*.Test.dll")
|> NUnit3 (nunitSetParams "cat!=Long"))
Target "LongTests" (fun _ ->
!! (testDir + "/**/bin/Debug/*.Test.dll")
|> NUnit3 (nunitSetParams "cat==Long"))
Target "AllTests" (fun _ ->
!! (testDir + "/**/bin/Debug/*.Test.dll")
|> NUnit3 (nunitSetParams ""))
Target "Lint" (fun _ ->
!! "**/**/*.fsproj" |> Seq.iter (FSharpLint id))
"BuildTest" ==> "LongTests"
"BuildTest" ==> "AllTests"
"Clean"
==> "BuildTest"
==> "Lint"
==> "Test"
==> "Build"
RunTargetOrDefault "Build"