forked from danm-de/pcsc-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.fsx
67 lines (57 loc) · 1.46 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
// include Fake lib
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
open Fake.Testing.NUnit3
// Properties
let buildDir = "./.build/"
let nugetDir = buildDir @@ "nuget"
let binaryOutDir = ""
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 "DotNetRestore" (fun _ ->
DotNetCli.Restore
(fun p ->
{ p with
NoCache = true })
)
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 "NuGetPush" (fun _ ->
CreateDir nugetDir
!! (sprintf "src/**/bin/%s/*.nupkg" buildConfig)
|> CopyFiles nugetDir
Paket.Push(fun p ->
{p with
DegreeOfParallelism = 1
WorkingDir = nugetDir
})
)
Target "Default" (fun _ ->
trace "PC/SC wrapper classes for .NET"
)
// Dependencies
"Clean"
==> "DotNetRestore"
==> "Build"
==> "Test"
==> "Default"
"Build"
==> "NuGetPush"
// start build
RunTargetOrDefault "Default"