-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.fsx
58 lines (45 loc) · 1.03 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
// include Fake libs
#r "./packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Testing.Expecto
// Directories
let buildDir = "./build/"
let deployDir = "./deploy/"
// Filesets
let appReferences =
!! "/**/*.csproj"
++ "/**/*.fsproj"
// version info
let version = "0.1" // or retrieve from CI server
// Targets
Target "Clean" (fun _ ->
CleanDirs [buildDir; deployDir]
)
Target "Build" (fun _ ->
// compile all projects below src/app/
MSBuildDebug buildDir "Build" appReferences
|> Log "AppBuild-Output: "
)
// define test executables
let testExecutables = !! (buildDir + "/*.Test.exe")
Target "Test" (fun _ ->
testExecutables
|> Expecto (fun p ->
{ p with
Debug = true
Parallel = true
ListTests = false
})
)
Target "Deploy" (fun _ ->
!! (buildDir + "/**/*.*")
-- "*.zip"
|> Zip buildDir (deployDir + "ApplicationName." + version + ".zip")
)
// Build order
"Clean"
==> "Build"
==> "Test"
==> "Deploy"
// start build
RunTargetOrDefault "Test"