Skip to content

Commit 886310b

Browse files
committed
Address code review feedback
1 parent fdd210c commit 886310b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

utils/build.ps1

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,16 +599,17 @@ function Invoke-BuildStep {
599599
$SplatArgs += $Arg
600600
$i++
601601
} elseif ($Arg -is [string] -and $Arg.StartsWith('-')) {
602-
$paramName = $Arg.TrimStart('-')
602+
$ParamName = $Arg.TrimStart('-')
603603

604604
# Check if the next argument is a value for this parameter
605-
if ($i -lt $RemainingArgs.Count - 1 -and ($RemainingArgs[$i + 1] -isnot [string] -or !$RemainingArgs[$i + 1].StartsWith('-'))) {
605+
$HasNextArg = ($i -lt $RemainingArgs.Count - 1)
606+
if ($HasNextArg -and $RemainingArgs[$i + 1] -is [string] -and !$RemainingArgs[$i + 1].StartsWith('-')) {
606607
# This is a named parameter with a value
607-
$SplatArgs[$paramName] = $RemainingArgs[$i + 1]
608+
$SplatArgs[$ParamName] = $RemainingArgs[$i + 1]
608609
$i += 2
609610
} else {
610611
# This is a switch parameter (flag)
611-
$SplatArgs[$paramName] = $true
612+
$SplatArgs[$ParamName] = $true
612613
$i++
613614
}
614615
} else {
@@ -3154,7 +3155,6 @@ function Build-Installer([Hashtable] $Platform) {
31543155
BundleFlavor = "offline";
31553156
ImageRoot = "$(Get-InstallDir $Platform)\";
31563157
INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC;
3157-
INCLUDE_NOASSERTS = $IncludeNoAsserts;
31583158
SWIFT_DOCC_BUILD = "$(Get-ProjectBinaryCache $HostPlatform DocC)\release";
31593159
SWIFT_DOCC_RENDER_ARTIFACT_ROOT = "${SourceCache}\swift-docc-render-artifact";
31603160
}
@@ -3171,6 +3171,7 @@ function Build-Installer([Hashtable] $Platform) {
31713171
$Properties["Platforms"] = "`"windows$(if ($Android) { ";android" })`"";
31723172
$Properties["AndroidArchitectures"] = "`"$(($AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join ";")`""
31733173
$Properties["WindowsArchitectures"] = "`"$(($WindowsSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join ";")`""
3174+
$Properties["ToolchainVariants"] = "`"asserts$(if ($IncludeNoAsserts) { ";noasserts" })`"";
31743175
foreach ($SDKPlatform in $WindowsSDKPlatforms) {
31753176
$Properties["WindowsRuntime$($SDKPlatform.Architecture.ShortName.ToUpperInvariant())"] = [IO.Path]::Combine((Get-InstallDir $SDKPlatform), "Runtimes", "$ProductVersion");
31763177
}

0 commit comments

Comments
 (0)