-
Notifications
You must be signed in to change notification settings - Fork 40
/
Copy pathbuild.fsx
96 lines (77 loc) · 2.2 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// include Fake lib
#r @"packages/FAKE/tools/FakeLib.dll"
open System
open System.IO
open Fake
RestorePackages()
// Directories
let buildDir = @".\build\"
let testDir = @".\test\"
let deployDir = @".\deploy\"
// Properties
let buildNumber = getBuildParamOrDefault "buildNumber" "0"
let releaseNotes =
ReadFile "ReleaseNotes.md"
|> ReleaseNotesHelper.parseReleaseNotes
let projectName = "BinaryRage"
let version = releaseNotes.AssemblyVersion + "." + buildNumber
// Targets
Target "Clean" (fun _ ->
trace " --- Cleaning directories --- "
CleanDirs [buildDir; testDir; deployDir]
)
open Fake.AssemblyInfoFile
Target "SetAssemblyInfo" (fun _ ->
trace " --- Setting assembly version information --- "
CreateCSharpAssemblyInfo "./Properties/AssemblyVersionInfo.cs"
[Attribute.Version version
Attribute.InformationalVersion version
Attribute.FileVersion version]
)
Target "BuildBinaryRage" (fun _ ->
trace " --- Building BinaryRage --- "
!! @".\BinaryRage.csproj"
|> MSBuildRelease buildDir "Build"
|> Log "AppBuild-Output: "
trace " --- Fininshed building BinaryRage --- "
)
Target "BuildTests" (fun _ ->
!! @".\BinaryRage.UnitTests\BinaryRage.FunctionalTests.csproj"
|> MSBuildDebug testDir "Build"
|> Log "TestBuild-Output: "
)
Target "RunTests" (fun _ ->
!! (testDir + @"\BinaryRage.UnitTests.dll")
|> NUnit (fun p ->
{p with
DisableShadowCopy = true;
OutputFile = testDir + @"TestResults.xml"})
)
Target "Deploy" (fun _ ->
CopyDir deployDir buildDir allFiles
)
Target "CreateNugetPackage" (fun _ ->
NuGet (fun p ->
{p with
Project = projectName
Version = version
OutputPath = deployDir
WorkingDir = buildDir
NoPackageAnalysis = false
Publish = false
ToolPath = @".\tools\nuget\nuget.exe"
})
(@".\BinaryRage.nuspec")
)
Target "Default" DoNothing
// Dependencies
"Clean"
==> "SetAssemblyInfo"
==> "BuildBinaryRage"
==> "BuildTests"
==> "RunTests"
==> "Deploy"
==> "CreateNugetPackage"
==> "Default"
// start build
RunTargetOrDefault "Default"