-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
81 lines (68 loc) · 1.85 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
// include Fake lib
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Testing.NUnit3
// Properties
let buildDir = "./.build/"
let nugetDir = buildDir @@ "nuget"
let symbolDir = buildDir @@ "symbols"
let binaryOutDir = ""
let packagingDir = buildDir + "/package"
let buildConfig = environVarOrDefault "build_configuration" "Release"
// Targets
Target "Clean" (fun _ ->
CleanDir buildDir
!! "*.sln"
|> MSBuild binaryOutDir "Clean" ["Configuration", buildConfig; "Platform", "Any CPU"]
|> Log "MSBuild-Clean: "
)
Target "Build" (fun _ ->
!! "*.sln"
|> MSBuild binaryOutDir "Build" ["Configuration", buildConfig; "Platform", "Any CPU"]
|> Log "MSBuild: "
)
Target "Test" (fun _ ->
!! (sprintf "Tests/**/bin/%s/*.Tests.dll" buildConfig)
|> NUnit3 (fun p ->
{p with
ShadowCopy = false
})
)
Target "NuGet" (fun _ ->
Paket.Pack(fun p ->
{p with
Symbols = true;
OutputPath = buildDir })
ensureDirectory nugetDir
ensureDirectory symbolDir
!! (buildDir @@ "*.nupkg")
|> Seq.iter (fun file -> MoveFile nugetDir file)
!! (nugetDir @@ "*.symbols.nupkg")
|> Seq.iter (fun file -> MoveFile symbolDir file)
)
Target "NuGetPush" (fun _ ->
Paket.Push(fun p ->
{p with
DegreeOfParallelism = 1
WorkingDir = nugetDir
})
Paket.Push(fun p ->
{p with
PublishUrl = "https://nuget.smbsrc.net/"
DegreeOfParallelism = 1
WorkingDir = symbolDir
})
)
Target "Default" (fun _ ->
trace "PC/SC wrapper classes for .NET"
)
// Dependencies
"Clean"
==> "Build"
==> "NuGet"
==> "Test"
==> "Default"
"NuGet"
==> "NuGetPush"
// start build
RunTargetOrDefault "Default"