-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBuild.fsx
77 lines (57 loc) · 1.77 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
#r "packages/FAKE/tools/FakeLib.dll"
#I @"packages/SourceLink.Fake/tools"
#load "SourceLink.fsx"
#load "SourceLink.Tfs.fsx"
open System
open System.IO
open Fake
open SourceLink
let projectName = "Mozu.Api.WebToolKit"
//NOTE! you need to increment this if you want the version published to change.
let version = "1.2.6-RC3"
let bin = "bin"
Target "Clean" (fun _ -> !! "**/bin/" ++ "**/obj/" |> CleanDirs)
Target "BuildSln" (fun _ ->
let getBuildParams p =
{Fake.MSBuildHelper.MSBuildDefaults with
Targets = ["Rebuild"]
Properties = [("Configuration", "Release");] }
build getBuildParams "Mozu.Api.WebToolKit.sln"
)
Target "Test" (fun _ ->
let parameters =
{ NUnitDefaults with
Framework = "net-45"
ToolPath = @"packages\Nunit.runners\tools" }
!! "**/*.Tests.dll"
-- ".\packages\*"
|> NUnit (fun p -> p)
)
Target "NuGet" (fun _ ->
ensureDirectory bin
NuGet (fun p ->
{ p with
Version = version
OutputPath = bin
WorkingDir = ".\Mozu.Api.WebToolkit"
ToolPath = "nuget.exe"
}) "Mozu.Api.WebToolKit\Mozu.Api.WebToolKit.nuspec"
)
Target "Publish" (fun _ ->
let setParams (p : NuGetParams) =
{p with
PublishUrl = getBuildParam "publishUrl"
TimeOut = TimeSpan.FromMinutes 5.0
Project = projectName
WorkingDir = ".\Mozu.Api.WebToolkit"
ToolPath = "nuget.exe"
Version = version
OutputPath = bin }
if not (hasBuildParam "publishUrl") then failwith "the build param PublishUrl mst be present to publish"
NuGetPublish setParams
)
"Clean"
==> "BuildSln"
==> "NuGet"
"NuGet" ==> "Publish"
RunTargetOrDefault "NuGet"