Skip to content

Commit

Permalink
Merge pull request dotnet#14797 from BruceForstall/FixBuildCmdPriorit…
Browse files Browse the repository at this point in the history
…yHandling

Fix handling of `-priority=N` argument in build.cmd
  • Loading branch information
BruceForstall authored Nov 2, 2017
2 parents 0fc8b13 + c7745a9 commit 7dc0f27
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ set __BuildPackages=1
set __BuildNativeCoreLib=1
set __RestoreOptData=1

@REM CMD has a nasty habit of eating "=" on the argument list, so passing:
@REM -priority=1
@REM appears to CMD parsing as "-priority 1". Handle -priority specially to avoid problems,
@REM and allow the "-priority=1" syntax.
set __Priority=

:Arg_Loop
if "%1" == "" goto ArgsDone

Expand Down Expand Up @@ -154,6 +160,8 @@ if /i "%1" == "debug" (set __BuildTypeDebug=1&set processedArgs=!p
if /i "%1" == "checked" (set __BuildTypeChecked=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)
if /i "%1" == "release" (set __BuildTypeRelease=1&set processedArgs=!processedArgs! %1&shift&goto Arg_Loop)

if /i "%1" == "-priority" (set __Priority=%2&shift&set processedArgs=!processedArgs! %1=%2&shift&goto Arg_Loop)

REM All arguments after this point will be passed through directly to build.cmd on nested invocations
REM using the "all" argument, and must be added to the __PassThroughArgs variable.
if [!__PassThroughArgs!]==[] (
Expand Down Expand Up @@ -218,6 +226,16 @@ if [!processedArgs!]==[] (

:ArgsDone

@REM Special handling for -priority=N argument.
if defined __Priority (
if defined __PassThroughArgs (
set __PassThroughArgs=%__PassThroughArgs% -priority=%__Priority%
) else (
set __PassThroughArgs=-priority=%__Priority%
)
set __UnprocessedBuildArgs=!__UnprocessedBuildArgs! -priority=%__Priority%
)

if %__PgoOptimize%==0 set __RestoreOptData=0

if defined __BuildAll goto BuildAll
Expand Down

0 comments on commit 7dc0f27

Please sign in to comment.