Merge pull request #5171 from wtgodbe/syncFix
[platform/upstream/coreclr.git] / build-packages.cmd
1 @if "%_echo%" neq "on" echo off
2 setlocal EnableDelayedExpansion
3
4 set "__ProjectDir=%~dp0"
5 set packagesLog=build-packages.log
6 set binclashLoggerDll=%~dp0Tools\net45\Microsoft.DotNet.Build.Tasks.dll
7 set binclashlog=%~dp0binclash.log
8 echo Running build-packages.cmd %* > %packagesLog%
9
10 set options=/nologo /maxcpucount /v:minimal /clp:Summary /nodeReuse:false /flp:v=detailed;Append;LogFile=%packagesLog% /l:BinClashLogger,%binclashLoggerDll%;LogFile=%binclashlog% /p:FilterToOSGroup=Windows_NT
11 set allargs=%*
12
13 if /I [%1] == [/?] goto Usage
14 if /I [%1] == [/help] goto Usage
15
16 REM ensure that msbuild is available
17 echo Running init-tools.cmd
18 call %~dp0init-tools.cmd
19
20 set __msbuildArgs="%__ProjectDir%\src\.nuget\Microsoft.NETCore.Runtime.CoreClr\Microsoft.NETCore.Runtime.CoreCLR.builds" !allargs!
21 echo msbuild.exe %__msbuildArgs% !options! >> %packagesLog%
22 call msbuild.exe %__msbuildArgs% !options!
23 if NOT [!ERRORLEVEL!]==[0] (
24   echo ERROR: An error occurred while building packages, see %packagesLog% for more details.
25   exit /b 1
26 )
27
28 set __msbuildArgs="%__ProjectDir%\src\.nuget\Microsoft.NETCore.Jit\Microsoft.NETCore.Jit.builds" !allargs!
29 echo msbuild.exe %__msbuildArgs% !options! >> %packagesLog%
30 call msbuild.exe %__msbuildArgs% !options!
31 if NOT [!ERRORLEVEL!]==[0] (
32   echo ERROR: An error occurred while building packages, see %packagesLog% for more details.
33   exit /b 1
34 )
35
36 rem Build the ILAsm package
37 set __msbuildArgs="%__ProjectDir%\src\.nuget\Microsoft.NETCore.ILAsm\Microsoft.NETCore.ILAsm.builds" !allargs!
38 echo msbuild.exe %__msbuildArgs% !options! >> %packagesLog%
39 call msbuild.exe %__msbuildArgs% !options!
40 if NOT [!ERRORLEVEL!]==[0] (
41   echo ERROR: An error occurred while building packages, see %packagesLog% for more details.
42   exit /b 1
43 )
44
45 rem Build the ILDAsm package
46 set __msbuildArgs="%__ProjectDir%\src\.nuget\Microsoft.NETCore.ILDAsm\Microsoft.NETCore.ILDAsm.builds" !allargs!
47 echo msbuild.exe %__msbuildArgs% !options! >> %packagesLog%
48 call msbuild.exe %__msbuildArgs% !options!
49 if NOT [!ERRORLEVEL!]==[0] (
50   echo ERROR: An error occurred while building packages, see %packagesLog% for more details.
51   exit /b 1
52 )
53
54 echo Done Building Packages.
55 exit /b
56
57 :Usage
58 echo.
59 echo Builds the NuGet packages from the binaries that were built in the Build product binaries step.
60 echo The following properties are required to define build architecture
61 echo   /p:__BuildArch=[architecture] /p:__BuildType=[configuration]
62 echo Architecture can be x64, x86, arm, or arm64
63 echo Configuration can be Release, Debug, or Checked
64 exit /b