-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.fsx
78 lines (65 loc) · 1.67 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
// include Fake lib
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.AssemblyInfoFile
open XUnit2Helper
RestorePackages()
// Properties
let buildDir = "./build/"
let testResultsDir = "./testresults/"
let nugetDir = buildDir @@ "nuget"
let version = "0.8.3.0"
// Targets
Target "Clean" (fun _ ->
CleanDir buildDir
CleanDir nugetDir
CleanDir testResultsDir
)
Target "UpdateVersion" (fun _ ->
BulkReplaceAssemblyInfoVersions "." (fun f ->
{f with
AssemblyVersion = version
AssemblyFileVersion = version})
)
Target "Build" (fun _ ->
!! "./src/**/*.csproj"
|> MSBuildRelease buildDir "Build"
|> Log "Build-Output: "
)
Target "BuildTests" (fun _ ->
!! "./tests/**/*.csproj"
|> MSBuildDebug null "Build"
|> ignore
)
Target "RunTests" (fun _ ->
!! "./tests/**/bin/debug/*Tests.dll"
|> xUnit2 (fun p ->
{p with
Parallel = ParallelOption.All
ShadowCopy = false;
HtmlOutput = true;
OutputDir = testResultsDir})
)
Target "CreateNugets" (fun _ ->
let index = version.LastIndexOf '.' - 1
let semanticVersion = version.[..index]
let nuspecs = !! "./src/**/*.nuspec"
for nuspec in nuspecs do
nuspec
|> NuGet (fun p ->
{p with
Version = semanticVersion
OutputPath = nugetDir
WorkingDir = buildDir})
)
Target "All" DoNothing
// Dependencies
"Clean"
==> "UpdateVersion"
==> "Build"
==> "BuildTests"
==> "RunTests"
==> "CreateNugets"
==> "All"
// Start build
RunTargetOrDefault "All"