Skip to content

Commit 5629fbe

Browse files
committed
Merge pull request #55 from jvandertil/nuget-pack-fix
Fix build script NuGet packaging for FAKE 3.x. Note for people who have FAKE 2.x installed: you will need to clear the build/tools/FAKE folder and re-run the build script!
2 parents ed1281f + f02fff7 commit 5629fbe

File tree

3 files changed

+18
-19
lines changed

3 files changed

+18
-19
lines changed

build/FoundationDB.Client.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<tags>foundationdb nosql</tags>
1818
</metadata>
1919
<files>
20-
<file src="output\FoundationDB.Client\FoundationDB.Client.dll" target="lib\net45" />
21-
<file src="output\FoundationDB.Client\FoundationDB.Client.XML" target="lib\net45" />
22-
<file src="output\FoundationDB.Client\FoundationDB.Client.pdb" target="lib\net45" />
20+
<file src="FoundationDB.Client.dll" target="lib\net45" />
21+
<file src="FoundationDB.Client.XML" target="lib\net45" />
22+
<file src="FoundationDB.Client.pdb" target="lib\net45" />
2323
</files>
2424
</package>

build/FoundationDB.Layers.Common.nuspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
</dependencies>
2121
</metadata>
2222
<files>
23-
<file src="output\FoundationDB.Layers.Common\FoundationDB.Layers.Common.dll" target="lib\net-45" />
24-
<file src="output\FoundationDB.Layers.Common\FoundationDB.Layers.Common.XML" target="lib\net-45" />
25-
<file src="output\FoundationDB.Layers.Common\FoundationDB.Layers.Common.pdb" target="lib\net-45" />
23+
<file src="FoundationDB.Layers.Common.dll" target="lib\net-45" />
24+
<file src="FoundationDB.Layers.Common.XML" target="lib\net-45" />
25+
<file src="FoundationDB.Layers.Common.pdb" target="lib\net-45" />
2626
</files>
2727
</package>

build/build.fsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ RestorePackages()
77

88
// Properties
99
let version = "0.9.9-pre" //TODO: find a way to extract this from somewhere convenient
10-
let buildDir = "./build/output/"
11-
let nugetPath = ".nuget/nuget.exe"
12-
let nugetOutDir = buildDir + "_packages/"
10+
let buildDir = FileUtils.pwd() @@ "build" @@ "output"
11+
let nugetPath = FileUtils.pwd() @@ ".nuget" @@ "nuget.exe"
12+
let nugetOutDir = buildDir @@ "_packages"
1313

1414
let BuildProperties =
1515
[
1616
"TargetPlatform", "AnyCPU"
1717
"AllowUnsafeBlocks", "true"
1818
]
1919

20-
Target "Clean" (fun _ ->
20+
Target "Clean" (fun _ ->
2121
CleanDir buildDir
2222
)
2323
// Default target
@@ -34,7 +34,7 @@ let buildProject mode =
3434

3535
//Compile each csproj and output it separately in build/output/PROJECTNAME
3636
!! "**/*.csproj"
37-
|> Seq.map(fun f -> (f, buildDir + directoryInfo(f).Name.Replace(".csproj", "")))
37+
|> Seq.map(fun f -> (f, buildDir @@ directoryInfo(f).Name.Replace(".csproj", "")))
3838
|> Seq.iter(fun (f,d) -> MSBuild d "Build" (BuildProperties @ [ "Configuration", mode ]) (seq { yield f }) |> ignore)
3939

4040
Target "BuildAppRelease" (fun _ ->
@@ -49,10 +49,10 @@ Target "BuildAppDebug" (fun _ ->
4949

5050
Target "Test" (fun _ ->
5151
traceHeader "RUNNING UNIT TESTS"
52-
let testDir = buildDir + "tests/"
52+
let testDir = buildDir @@ "tests"
5353
CreateDir testDir
5454
ActivateFinalTarget "CloseTestRunner"
55-
!!(buildDir + "**/*Test*.dll")
55+
!! (buildDir @@ "**" @@ "*Test*.dll")
5656
//++(buildDir + "**/*Test*.exe")
5757
|> NUnit(
5858
fun p -> { p with DisableShadowCopy = true
@@ -63,7 +63,7 @@ Target "Test" (fun _ ->
6363
TimeOut = System.TimeSpan.FromMinutes 10.0
6464
ExcludeCategory = "LongRunning,LocalCluster" }))
6565

66-
FinalTarget "CloseTestRunner" (fun _ ->
66+
FinalTarget "CloseTestRunner" (fun _ ->
6767
ProcessHelper.killProcess "nunit-agent.exe"
6868
)
6969

@@ -79,22 +79,22 @@ let replaceVersionInNuspec nuspecFileName version =
7979

8080
Target "BuildNuget" (fun _ ->
8181
trace "Building Nuget Packages"
82-
let projects = [ "FoundationDb.Client"; "FoundationDb.Layers.Common" ]
82+
let projects = [ "FoundationDb.Client"; "FoundationDb.Layers.Common" ]
8383
CreateDir nugetOutDir
8484
projects
8585
|> List.iter (
8686
fun name ->
87-
let nuspec = sprintf @"build\%s.nuspec" name
87+
let nuspec = "build" @@ (sprintf "%s.nuspec" name)
8888
replaceVersionInNuspec nuspec version
89-
let binariesDir = sprintf "%s/%s/" buildDir name
89+
let binariesDir = buildDir @@ name
9090
NuGetPack (
9191
fun p ->
9292
{ p with WorkingDir = binariesDir
9393
OutputPath = nugetOutDir
9494
ToolPath = nugetPath
9595
Version = version}) nuspec
9696

97-
let targetLoc = (buildDir + (sprintf "%s/%s.%s.nupkg" name name version))
97+
let targetLoc = (buildDir @@ name @@ (sprintf "%s.%s.nupkg" name version))
9898
trace targetLoc
9999

100100
(*MoveFile nugetOutDir (buildDir + (sprintf "%s/%s/.%s.nupkg" name name version))*)
@@ -109,4 +109,3 @@ Target "Default" (fun _ -> trace "Starting build")
109109

110110
// start build
111111
RunTargetOrDefault "Build"
112-

0 commit comments

Comments
 (0)