From 84cf1755f2d00342f2d388a006a0ac84c23d7bb4 Mon Sep 17 00:00:00 2001 From: Steffen Forkmann Date: Sat, 2 Nov 2013 00:12:29 +0100 Subject: [PATCH] Allow to specify the build mode. --- build.cmd | 7 +++++-- build.fsx | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/build.cmd b/build.cmd index 7bf77a72..98a81db6 100644 --- a/build.cmd +++ b/build.cmd @@ -9,8 +9,11 @@ if not exist tools\FAKE.Core\tools\Fake.exe ( SET TARGET="Default" IF NOT [%1]==[] (set TARGET="%1") - -"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" + +SET BUILDMODE="Release" +IF NOT [%2]==[] (set BUILDMODE="%2") + +"tools\FAKE.Core\tools\Fake.exe" "build.fsx" "target=%TARGET%" "buildMode=%BUILDMODE%" rem Bail if we're running a TeamCity build. if defined TEAMCITY_PROJECT_NAME goto Quit diff --git a/build.fsx b/build.fsx index 4d1e9c7c..67e55a5c 100644 --- a/build.fsx +++ b/build.fsx @@ -24,6 +24,8 @@ let releaseNotes = ReadFile "ReleaseNotes.md" |> ReleaseNotesHelper.parseReleaseNotes +let buildMode = getBuildParamOrDefault "buildMode" "Release" + Target "Clean" (fun _ -> CleanDirs [buildDir; reactiveBuildDir; testResultsDir; packagingRoot; packagingDir; reactivePackagingDir] ) @@ -38,12 +40,12 @@ Target "AssemblyInfo" (fun _ -> ) Target "BuildApp" (fun _ -> - MSBuildWithDefaults "Build" ["./Octokit.sln"] + MSBuild null "Build" ["Configuration", buildMode] ["./Octokit.sln"] |> Log "AppBuild-Output: " ) Target "UnitTests" (fun _ -> - !! "./Octokit.Tests/bin/Release/**/Octokit.Tests*.dll" + !! (sprintf "./Octokit.Tests/bin/%s/**/Octokit.Tests*.dll" buildMode) |> xUnit (fun p -> {p with XmlOutput = true @@ -52,7 +54,7 @@ Target "UnitTests" (fun _ -> Target "IntegrationTests" (fun _ -> if hasBuildParam "OCTOKIT_GITHUBUSERNAME" && hasBuildParam "OCTOKIT_GITHUBPASSWORD" then - !! "./Octokit.Tests.Integration/bin/Release/**/Octokit.Tests.Integration.dll" + !! (sprintf "./Octokit.Tests.Integration/bin/%s/**/Octokit.Tests.Integration.dll" buildMode) |> xUnit (fun p -> {p with XmlOutput = true