forked from sbmako/NServiceBus.MongoDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.cmd
36 lines (29 loc) · 1014 Bytes
/
build.cmd
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
@echo off
rem Helper script for those who want to run psake from cmd.exe
rem psake "default.ps1" "BuildHelloWord" "4.0"
if '%1'=='/?' goto help
if '%1'=='-help' goto help
if '%1'=='-h' goto help
@ECHO OFF
SETLOCAL
SET POWRESHELL=powershell.exe -NoProfile -ExecutionPolicy Bypass -NonInteractive
SET PACKAGES=%~dp0\src\packages
@ECHO.
@ECHO Restoring NuGet Packages
"%~dp0\src\.nuget\NuGet.exe" restore "%~dp0\src\NServiceBus.MongoDB.sln" || GOTO BuildFailed
@ECHO.
@ECHO Executing psake build...
%POWRESHELL% -Command "& '%PACKAGES%\psake.4.4.1\tools\psake.ps1' default.ps1 %*; if ($psake.build_success -eq $false) { exit -1 } else { exit 0 }" ^
|| GOTO BuildFailed
@ECHO.
IF /I "%1"=="CleanAll" (
@ECHO Removing Downloaded NuGet Packages
%POWRESHELL% -Command "Dir '%PACKAGES%' | Where { $_.PSIsContainer } | ForEach { Remove-Item $_.FullName -Force -Recurse }" || GOTO BuildFailed
)
@ECHO.
@ECHO **** BUILD SUCCESSFUL ****
GOTO:EOF
:BuildFailed
@ECHO.
@ECHO *** BUILD FAILED ***
EXIT /B -1