Skip to content
This repository was archived by the owner on Feb 27, 2020. It is now read-only.

Commit 41244b9

Browse files
committed
More build script tweaking
1 parent ea7b18a commit 41244b9

1 file changed

Lines changed: 21 additions & 17 deletions

File tree

build.fsx

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,24 @@ let releaseNotes =
1818
ReadFile "ReleaseNotes.md"
1919
|> ReleaseNotesHelper.parseReleaseNotes
2020

21+
let private packageFileName project version = sprintf "%s.%s.nupkg" project version
22+
2123
MSBuildDefaults <- {
2224
MSBuildDefaults with
2325
ToolsVersion = Some "12.0"
2426
Verbosity = Some MSBuildVerbosity.Minimal
2527
}
2628

29+
let setParams defaults = {
30+
defaults with
31+
ToolsVersion = Some("12.0")
32+
Targets = ["Build"]
33+
Properties =
34+
[
35+
"Configuration", buildMode
36+
]
37+
}
38+
2739
Target "Clean" (fun _ ->
2840
CleanDirs [buildDir; packagingDir; packagingRoot;]
2941
)
@@ -38,25 +50,17 @@ Target "AssemblyInfo" (fun _ ->
3850
})
3951
)
4052

41-
let setParams defaults = {
42-
defaults with
43-
ToolsVersion = Some("12.0")
44-
Targets = ["Build"]
45-
Properties =
46-
[
47-
"Configuration", buildMode
48-
"RestorePackages", "true"
49-
]
50-
}
51-
5253
Target "BuildApp" (fun _ ->
53-
build setParams "./ScriptCs.Octokit.sln"
54-
|> DoNothing
54+
RestorePackages()
55+
build setParams "./ScriptCs.Octokit.sln"
56+
|> DoNothing
5557
)
5658

57-
let private packageFileName project version = sprintf "%s.%s.nupkg" project version
59+
Target "UnitTests" (fun _ ->
60+
trace "This is where unit tests should be run"
61+
)
5862

59-
Target "RunTests" (fun _ ->
63+
Target "EndToEndTests" (fun _ ->
6064
CopyFile localNuGet (packagingRoot @@ (packageFileName projectName releaseNotes.AssemblyVersion) )
6165

6266
let result = ExecProcess(fun info ->
@@ -91,7 +95,6 @@ Target "CreateNuGetPackage" (fun _ ->
9195
)
9296

9397
Target "PublishNuGetPackage" (fun _ ->
94-
trace "This is where we will publish the NuGet package to NuGet"
9598
NuGetPublish (fun p ->
9699
{p with
97100
OutputPath = packagingRoot
@@ -111,10 +114,11 @@ Target "PublishPackage" DoNothing
111114
"Clean"
112115
==> "AssemblyInfo"
113116
==> "BuildApp"
117+
==> "UnitTests"
114118
==> "Default"
115119
==> "CreateNuGetPackage"
116120
==> "CreatePackage"
117-
==> "RunTests"
121+
==> "EndToEndTests"
118122
=?> ("PublishNuGetPackage", hasBuildParam "nugetApiKey")
119123
==> "PublishPackage"
120124

0 commit comments

Comments
 (0)