-
Notifications
You must be signed in to change notification settings - Fork 137
/
build.cmd
40 lines (35 loc) · 999 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
37
38
39
40
@echo off
cd /d %~dp0
mode con:cols=120 lines=2500
set ROOTPATH=%cd%
set ROOTDIR=%cd%
set SOURCEPATH=%ROOTPATH%\src
echo ## Building Foundation please check the Build\Logs directory if you receive errors
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 ## NPM Install ##
cd %SOURCEPATH%\Foundation
echo CALL npm ci
IF %errorlevel% NEQ 0 (
set errorMessage=%errorlevel%
goto error
)
CALL npm run dev
cd %ROOTPATH%
echo ## Clean and build ##
"%InstallDir%%msBuildPath%" Foundation.sln /t:Clean,Build
cd %ROOTPATH%
:error
if NOT "%errorMessage%"=="" echo %errorMessage%
pause