-
Notifications
You must be signed in to change notification settings - Fork 6
/
Build.cmd
41 lines (33 loc) · 1.17 KB
/
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
37
38
39
40
@ECHO off
SETLOCAL
REM Parse command line arg if present
SET ARG1=%~1
SET ARG2=%~2
REM If command line arg present, set the BUILD_CONFIG
REM otherwise, prompt the user
IF NOT "%ARG1%" == "" SET BUILD_CONFIG=%ARG1:~-1%
IF "%ARG1%" == "" SET /P BUILD_CONFIG=Please select the build configuration to use (r = Release, d = Debug [Default]):
IF NOT "%ARG2%" == "" SET BUILD_TARGET=%ARG2:~-1%
IF "%ARG2%" == "" SET /P BUILD_TARGET=Please select the build target to use (b = build only [Default], u = build and package umbraco):
IF "%BUILD_TARGET%" == "" SET BUILD_TARGET=b
REM Covert build config flag to an actual config string
if "%BUILD_CONFIG%" == "r" (
SET BUILD_CONFIG=Release
) else (
SET BUILD_CONFIG=Debug
)
REM Covert build target flag to an actual config string
if "%BUILD_TARGET%" == "u" (
SET BUILD_TARGET=BuildAndPackageUmbraco
) else (
SET BUILD_TARGET=BuildOnly
)
REM Trigger the build
CALL Build\Tools\NuGet\NuGet.exe restore Source\TeaCommerce.StarterKit.sln
CALL "%programfiles(x86)%\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\amd64\MsBuild.exe" Build\Build.proj -target:%BUILD_TARGET%
ENDLOCAL
IF %ERRORLEVEL% NEQ 0 GOTO err
EXIT /B 0
:err
PAUSE
EXIT /B 1