diff options
author | Jose Perez Rodriguez <joperezr@microsoft.com> | 2016-04-15 23:45:59 +0300 |
---|---|---|
committer | Jose Perez Rodriguez <joperezr@microsoft.com> | 2016-04-15 23:45:59 +0300 |
commit | f7a08f93d4327d88c3d8a177627347e6d368d1e3 (patch) | |
tree | d15be2f5702839445a3bbd07fec0ba3004b195c2 /build.cmd | |
parent | be2360b0933de872e41321fb86a558dcd70e2fe3 (diff) |
Update BuildTools (#7724)
Update BuildTools
Diffstat (limited to 'build.cmd')
-rw-r--r-- | build.cmd | 51 |
1 files changed, 46 insertions, 5 deletions
@@ -1,5 +1,5 @@ @if "%_echo%" neq "on" echo off -setlocal +setlocal EnableDelayedExpansion :: Note: We've disabled node reuse because it causes file locking issues. :: The issue is that we extend the build with our own targets which @@ -8,9 +8,46 @@ setlocal :ReadArguments :: Read in the args to determine whether to run the native build, managed build, or both (default) -set "__args=%*" -if /i [%1] == [native] (set __buildSpec=native&&set "__args=%__args:~6%"&&shift&&goto Tools) -if /i [%1] == [managed] (set __buildSpec=managed&&set "__args=%__args:~7%"&&shift&&goto Tools) +set OfficialBuildIdArg= +set "__args= %*" +set processedArgs= +set unprocessedBuildArgs= + +:Loop +if [%1]==[] goto Tools + +if /I [%1]==[native] ( + set __buildSpec=native + set processedArgs=!processedArgs! %1 + goto Next +) + +if /I [%1] == [managed] ( + set __buildSpec=managed + set processedArgs=!processedArgs! %1 + goto Next +) + +if /I [%1] == [/p:OfficialBuildId] ( + if /I [%2]==[] ( + echo Error: officialbuildid arg should have a value + exit /b 1 + ) + set processedArgs=!processedArgs! %1=%2 + set OfficialBuildIdArg=/p:OfficialBuildId=%2 + shift /1 + goto Next +) + +if [!processedArgs!]==[] ( + call set unprocessedBuildArgs=!__args! +) else ( + call set unprocessedBuildArgs=%%__args:*!processedArgs!=%% +) + +:Next +shift /1 +goto Loop :Tools :: Setup VS @@ -35,6 +72,10 @@ if "%__buildSpec%"=="managed" goto :BuildManaged :BuildNative :: Run the Native Windows build echo [%time%] Building Native Libraries... +:: Generate Native versioning assets +set __binDir=%~dp0bin +set __versionLog=%~dp0version.log +msbuild "%~dp0build.proj" /nologo /t:GenerateVersionHeader /p:NativeVersionHeaderFile="%__binDir%\obj\_version.h" /p:GenerateVersionHeader=true %OfficialBuildIdArg% > "%__versionLog%" IF EXIST "%~dp0src\native\Windows\build-native.cmd" ( call %~dp0src\native\Windows\build-native.cmd %__args% >nativebuild.log IF ERRORLEVEL 1 ( @@ -72,7 +113,7 @@ call :build %__args% goto :AfterBuild :build -%_buildprefix% msbuild "%_buildproj%" /nologo /maxcpucount /v:minimal /clp:Summary /nodeReuse:false /flp:v=normal;LogFile="%_buildlog%";Append "/l:BinClashLogger,%_binclashLoggerDll%;LogFile=%_binclashlog%" %__args% %_buildpostfix% +%_buildprefix% msbuild "%_buildproj%" /nologo /maxcpucount /v:minimal /clp:Summary /nodeReuse:false /flp:v=normal;LogFile="%_buildlog%";Append "/l:BinClashLogger,%_binclashLoggerDll%;LogFile=%_binclashlog%" !unprocessedBuildArgs! %_buildpostfix% %OfficialBuildIdArg% set BUILDERRORLEVEL=%ERRORLEVEL% goto :eof |