Skip to content

Commit 3ba15e6

Browse files
committed
Address code review feedback
1 parent 07e6e52 commit 3ba15e6

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
@@ -653,16 +653,17 @@ function Invoke-BuildStep {
653653
$SplatArgs += $Arg
654654
$i++
655655
} elseif ($Arg -is [string] -and $Arg.StartsWith('-')) {
656-
$paramName = $Arg.TrimStart('-')
656+
$ParamName = $Arg.TrimStart('-')
657657

658658
# Check if the next argument is a value for this parameter
659-
if ($i -lt $RemainingArgs.Count - 1 -and ($RemainingArgs[$i + 1] -isnot [string] -or !$RemainingArgs[$i + 1].StartsWith('-'))) {
659+
$HasNextArg = ($i -lt $RemainingArgs.Count - 1)
660+
if ($HasNextArg -and $RemainingArgs[$i + 1] -is [string] -and !$RemainingArgs[$i + 1].StartsWith('-')) {
660661
# This is a named parameter with a value
661-
$SplatArgs[$paramName] = $RemainingArgs[$i + 1]
662+
$SplatArgs[$ParamName] = $RemainingArgs[$i + 1]
662663
$i += 2
663664
} else {
664665
# This is a switch parameter (flag)
665-
$SplatArgs[$paramName] = $true
666+
$SplatArgs[$ParamName] = $true
666667
$i++
667668
}
668669
} else {
@@ -3272,7 +3273,6 @@ function Build-Installer([Hashtable] $Platform) {
32723273
BundleFlavor = "offline";
32733274
ImageRoot = "$(Get-InstallDir $Platform)\";
32743275
INCLUDE_SWIFT_DOCC = $INCLUDE_SWIFT_DOCC;
3275-
INCLUDE_NOASSERTS = $IncludeNoAsserts;
32763276
SWIFT_DOCC_BUILD = "$(Get-ProjectBinaryCache $HostPlatform DocC)\release";
32773277
SWIFT_DOCC_RENDER_ARTIFACT_ROOT = "${SourceCache}\swift-docc-render-artifact";
32783278
}
@@ -3289,6 +3289,7 @@ function Build-Installer([Hashtable] $Platform) {
32893289
$Properties["Platforms"] = "`"windows$(if ($Android) { ";android" })`"";
32903290
$Properties["AndroidArchitectures"] = "`"$(($AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join ";")`""
32913291
$Properties["WindowsArchitectures"] = "`"$(($WindowsSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join ";")`""
3292+
$Properties["ToolchainVariants"] = "`"asserts$(if ($IncludeNoAsserts) { ";noasserts" })`"";
32923293
foreach ($SDKPlatform in $WindowsSDKPlatforms) {
32933294
$Properties["WindowsRuntime$($SDKPlatform.Architecture.ShortName.ToUpperInvariant())"] = [IO.Path]::Combine((Get-InstallDir $SDKPlatform), "Runtimes", "$ProductVersion");
32943295
}

0 commit comments

Comments
 (0)