forked from dotnet/coreclr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-packages.cmd
64 lines (53 loc) · 2.36 KB
/
build-packages.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
@if not defined _echo @echo off
setlocal EnableDelayedExpansion
set "__ProjectDir=%~dp0"
set "__RepoRootDir=%~dp0..\..\"
rem Remove after repo consolidation
if not exist "%__RepoRootDir%\.dotnet-runtime-placeholder" ( set "__RepoRootDir=!__ProjectDir!" )
set "__args=%*"
set processedArgs=
set unprocessedArgs=
set __MSBuildArgs=
:Arg_Loop
if "%1" == "" goto ArgsDone
if /I [%1] == [/?] goto Usage
if /I [%1] == [/help] goto Usage
REM CMD eats "=" on the argument list.
REM TODO: remove all -Property=Value type arguments here once we get rid of them in buildpipeline.
if /i "%1" == "-BuildArch" (set processedArgs=!processedArgs! %1=%2&set __MSBuildArgs=!__MSBuildArgs! /p:__BuildArch=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "-BuildType" (set processedArgs=!processedArgs! %1=%2&set __MSBuildArgs=!__MSBuildArgs! /p:__BuildType=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "-OfficialBuildId" (set processedArgs=!processedArgs! %1=%2&set __MSBuildArgs=!__MSBuildArgs! /p:OfficialBuildId=%2&shift&shift&goto Arg_Loop)
if /i "%1" == "--" (set processedArgs=!processedArgs! %1&shift)
REM handle any unprocessed arguments, assumed to go only after the processed arguments above
if [!processedArgs!]==[] (
set unprocessedArgs=%__args%
) else (
set unprocessedArgs=%__args%
for %%t in (!processedArgs!) do (
REM strip out already-processed arguments from unprocessedArgs
set unprocessedArgs=!unprocessedArgs:*%%t=!
)
)
:ArgsDone
set logFile=%__RepoRootDir%bin\Logs\build-packages.binlog
powershell -NoProfile -ExecutionPolicy ByPass -NoLogo -File "%__RepoRootDir%eng\common\build.ps1"^
-r -b -projects %__ProjectDir%src\.nuget\packages.builds^
-verbosity minimal /bl:%logFile% /nodeReuse:false^
/p:__BuildOS=Windows_NT^
/p:PortableBuild=true /p:FilterToOSGroup=Windows_NT^
%__MSBuildArgs% %unprocessedArgs%
if NOT [!ERRORLEVEL!]==[0] (
echo ERROR: An error occurred while building packages. See log for more details:
echo %logFile%
exit /b !ERRORLEVEL!
)
echo Done Building Packages.
exit /b
:Usage
echo.
echo Builds the NuGet packages from the binaries that were built in the Build product binaries step.
echo The following properties are required to define build architecture
echo -BuildArch=[architecture] -BuildType=[configuration]
echo Architecture can be x64, x86, arm, or arm64
echo Configuration can be Release, Debug, or Checked
exit /b