-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.fsx
45 lines (41 loc) · 1.31 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
// include Fake lib
#r "packages/FAKE/tools/FakeLib.dll"
open Fake
// Properties
let solutionFile = "SimpleToggle.sln"
let testDir = "./test/"
let packageDir = "./package/"
let testDlls = !!"/**/bin/Release/*Tests.dll"
let xUnitPath = "packages/xunit.runner.console/tools/xunit.console.exe"
let nugetKey = environVar "NUGETKEY"
let nugetUrl = environVar "NUGETURL"
let buildNumber =
match appVeyorBuildVersion with
| null -> "0.0.0"
| _ -> appVeyorBuildVersion
Target "Build" (fun _ ->
!!solutionFile
|> MSBuildRelease "" "Build"
|> Log "AppBuild-Output: ")
Target "Test" (fun _ ->
testDlls |> xUnit (fun p ->
{ p with ToolPath = xUnitPath
OutputDir = testDir }))
Target "NuGet" (fun _ ->
Paket.Pack(fun p ->
{ p with Version = buildNumber
OutputPath = packageDir })
let consoleOut = System.Console.Out
System.IO.TextWriter.Null |> System.Console.SetOut
Paket.Push(fun p ->
{ p with ApiKey = nugetKey
PublishUrl = nugetUrl
WorkingDir = packageDir })
System.Console.SetOut consoleOut)
Target "Default" DoNothing
Target "CI" DoNothing
// Dependencies
"Build" ==> "Test" ==> "Default"
"Build" ==> "Test" ==> "NuGet" ==> "CI"
// start build
RunTargetOrDefault "Default"