-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.fsx
70 lines (55 loc) · 1.65 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
#r "./packages/FAKE/tools/FakeLib.dll"
#r "./packages/FSharpLint/FSharpLint.Application.dll"
#r "./packages/FSharpLint/FSharpLint.FAKE.dll"
open Fake
open Fake.Testing
open FSharpLint.FAKE
open System
open System.IO
MSBuildDefaults <- { MSBuildDefaults with Verbosity = Some MSBuildVerbosity.Minimal }
// Directories
let buildDir = __SOURCE_DIRECTORY__ @@ @"build"
let testDir = __SOURCE_DIRECTORY__ @@ @"build"
// Filesets
let solutionFile = "Fs5150.sln"
let msbuildProps = [
"Configuration", "Debug"
"Platform", "Any CPU"
]
// Targets
Target "Clean" (fun _ ->
CleanDirs [buildDir]
!! solutionFile
|> MSBuild buildDir "Clean" msbuildProps
|> ignore
)
Target "Rebuild" DoNothing
Target "Lint" (fun _ ->
!! "**/*.fsproj"
|> Seq.iter (FSharpLint (fun p -> { p with FailBuildIfAnyWarnings = true })))
Target "Assemble" (fun _ ->
Shell.Exec("powershell.exe", "-NoLogo -NoProfile -ExecutionPolicy Bypass -File " + __SOURCE_DIRECTORY__ @@ @"bin\buildAllAsms.ps1") |> ignore)
Target "Build" (fun _ ->
!! solutionFile
|> MSBuild buildDir "Build" msbuildProps
|> ignore
)
let runTest pattern =
fun _ ->
!! (buildDir @@ pattern)
|> xUnit (fun p ->
{ p with
ToolPath = findToolInSubPath "xunit.console.exe" (currentDirectory @@ "tools" @@ "xUnit")
WorkingDir = Some testDir })
Target "Test" DoNothing
Target "UnitTests" (runTest "*.Tests*.dll")
"Assemble" ==> "Build"
"Lint" ==> "Build"
"Clean" ?=> "Lint"
"Clean" ?=> "Build"
"Clean" ==> "Rebuild"
"Build" ==> "Rebuild"
"Build" ?=> "UnitTests" ==> "Test"
"Rebuild" ==> "Test"
// start build
RunTargetOrDefault "Test"