forked from episerver/Foundation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
39 lines (32 loc) · 1.3 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
@echo off
cd /d %~dp0
mode con:cols=120 lines=2500
set ROOTPATH=%cd%
set ROOTDIR=%cd%
set SOURCEPATH=%ROOTPATH%\src
echo ## Building Foundation
echo ## Gettting MSBuildPath ##
for /f "usebackq tokens=*" %%i in (`.\build\vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do (
set InstallDir=%%i
)
for %%v in (15.0, 14.0) do (
if exist "%InstallDir%\MSBuild\%%v\Bin\MSBuild.exe" (
set msBuildPath=\MSBuild\%%v\Bin\MSBuild.exe
goto :finish
)
set msBuildPath=\MSBuild\Current\Bin\MSBuild.exe
)
:finish
echo msbuild.exe path: %InstallDir%%msBuildPath%
echo ## Restoring Nuget packages ##
.\build\nuget restore %ROOTPATH%\Foundation.sln
REM Set Release or Debug configuration.
IF "%1"=="Release" (set CONFIGURATION=Release) ELSE (set CONFIGURATION=Debug)
ECHO Building in %CONFIGURATION%
echo ## Clean and build ##
"%InstallDir%""%msBuildPath%" %ROOTPATH%\Foundation.sln /t:Clean,Build /property:Configuration=%CONFIGURATION%
IF %errorlevel% NEQ 0 EXIT /B %errorlevel%
REM Build Client
IF "%CONFIGURATION%"=="Release" ( call gulp -b "%SOURCEPATH%\Foundation" --color --gulpfile "%SOURCEPATH%\Foundation\Gulpfile.js" ) ELSE ( call gulp -b "%SOURCEPATH%\Foundation" --color --gulpfile "%SOURCEPATH%\Foundation\Gulpfile.js" )
IF %errorlevel% NEQ 0 EXIT /B %errorlevel%
pause