-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.fsx
86 lines (70 loc) · 1.91 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
// include Fake lib
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Paket
open Fake.AssemblyInfoFile
// Properties
let testDir = "bin/Debug"
let deployDir = "deploy"
let version = "3.0.0.0"
let projects = [
"src/CookComputing.XmlRpc.csproj"
"xmlrpcserver/CookComputing.XmlRpcServer.csproj"
"Test/Test.csproj" ]
// Targets
Target "Clean" (fun _ ->
!!"**/bin"
|> DeleteDirs
!!"**/obj"
|> DeleteDirs
DeleteDir deployDir
)
Target "Create AssemblyVersion" (fun _ ->
CreateCSharpAssemblyInfo "src/AssemblyBuildNumber.cs"
[Attribute.Version version
Attribute.InformationalVersion version
Attribute.FileVersion version]
CreateCSharpAssemblyInfo "xmlrpcserver/AssemblyBuildNumber.cs"
[Attribute.Version version
Attribute.InformationalVersion version
Attribute.FileVersion version]
)
Target "BuildDebug" (fun _ ->
projects
|> MSBuildDebug "" "Build"
|> Log "DebugBuild-Output: "
)
Target "BuildRelease" (fun _ ->
projects
|> MSBuildRelease "" "Build"
|> Log "ReleaseBuild-Output: "
)
Target "Test" (fun _ ->
!!(testDir @@ "Test.dll")
|> NUnit(fun p ->
{ p with DisableShadowCopy = true
OutputFile = testDir @@ "TestResults.xml"
ToolPath = "packages/NUnit.Runners/tools"})
)
Target "CreatePackage" (fun _ ->
Pack(fun p ->
{ p with OutputPath = deployDir
TemplateFile = "paket.template"
WorkingDir = "."
Version = version
ToolPath = ".paket/paket.exe" })
)
Target "PushPackage" (fun _ ->
Push(fun p ->
{ p with WorkingDir = deployDir })
)
// Dependencies
"Clean"
==> "Create AssemblyVersion"
==> "BuildDebug"
==> "Test"
==> "BuildRelease"
==> "CreatePackage"
==> "PushPackage"
// start build
RunTargetOrDefault "BuildRelease"