-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.fsx
63 lines (48 loc) · 1.35 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
#I @"packages\build\Fake\tools"
#r "FakeLib.dll"
open Fake
(* properties *)
let authors = ["Max Malook"]
let projectName = "FeatureSwitcher.Examples"
TraceEnvironmentVariables()
let version = if isLocalBuild then getBuildParamOrDefault "version" "0.0.0.1" else buildVersion
(* Directories *)
let sourceDir = "./Source/"
let buildDir = "./Build/"
let testDir = buildDir
let testOutputDir = buildDir @@ "Specs/"
let deployDir = "./Release/"
(* files *)
let slnReferences = !! (sourceDir @@ "*.sln")
(* Targets *)
Target "Clean" (fun _ ->
CleanDirs [buildDir; testDir; testOutputDir; deployDir]
)
Target "BuildApp" (fun _ ->
MSBuildRelease buildDir "Build" slnReferences
|> Log "AppBuild-Output: "
)
Target "Test" (fun _ ->
ActivateFinalTarget "DeployTestResults"
!! (testDir @@ "/*.Specs.dll")
|> MSpec (fun p ->
{p with
HtmlOutputDir = testOutputDir})
)
FinalTarget "DeployTestResults" (fun () ->
!! (testOutputDir @@ "/**/*.*")
|> Zip testOutputDir (deployDir @@ "MSpecResults.zip")
)
Target "BuildZip" (fun _ ->
!! (buildDir @@ "**/*.*")
|> Zip buildDir (deployDir @@ sprintf "%s-%s.zip" projectName version)
)
Target "Default" DoNothing
// Build order
"Clean"
==> "BuildApp"
==> "Test"
==> "BuildZip"
==> "Default"
// start build
RunParameterTargetOrDefault "target" "Default"