Skip to content

Commit 2e970e1

Browse files
build.ps1: Update the msbuild installer call
1 parent 20817bb commit 2e970e1

File tree

1 file changed

+12
-49
lines changed

1 file changed

+12
-49
lines changed

build.ps1

Lines changed: 12 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -597,22 +597,23 @@ function Build-WiXProject() {
597597

598598
$Properties = $Properties.Clone()
599599
TryAdd-KeyValue $Properties Configuration Release
600-
TryAdd-KeyValue $Properties BaseOutputPath "$($Arch.BinaryCache)\msi\"
600+
TryAdd-KeyValue $Properties BaseOutputPath "$($Arch.BinaryCache)\installer\"
601601
TryAdd-KeyValue $Properties ProductArchitecture $ArchName
602602
TryAdd-KeyValue $Properties ProductVersion $ProductVersionArg
603603

604604
$MSBuildArgs = @("$SourceCache\swift-installer-scripts\platforms\Windows\$FileName")
605605
$MSBuildArgs += "-noLogo"
606606
$MSBuildArgs += "-restore"
607+
$MSBuildArgs += "-maxCpuCount"
607608
foreach ($Property in $Properties.GetEnumerator()) {
608609
if ($Property.Value.Contains(" ")) {
609610
$MSBuildArgs += "-p:$($Property.Key)=$($Property.Value.Replace('\', '\\'))"
610611
} else {
611612
$MSBuildArgs += "-p:$($Property.Key)=$($Property.Value)"
612613
}
613614
}
614-
$MSBuildArgs += "-bl:$($Arch.BinaryCache)\msi\$ArchName-$([System.IO.Path]::GetFileNameWithoutExtension($FileName)).binlog"
615-
$MSBuildArgs += "-ds:False"
615+
$MSBuildArgs += "-binaryLogger:$($Arch.BinaryCache)\msi\$ArchName-$([System.IO.Path]::GetFileNameWithoutExtension($FileName)).binlog"
616+
$MSBuildArgs += "-detailedSummary:False"
616617

617618
Invoke-Program $msbuild @MSBuildArgs
618619
}
@@ -1405,53 +1406,23 @@ function Build-DocC() {
14051406
}
14061407

14071408
function Build-Installer() {
1408-
Build-WiXProject bld\bld.wixproj -Arch $HostArch -Properties @{
1409-
DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\";
1410-
TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\";
1411-
}
1412-
1413-
Build-WiXProject cli\cli.wixproj -Arch $HostArch -Properties @{
1409+
Build-WiXProject bundle\installer.wixproj -Arch $HostArch -Properties @{
14141410
DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\";
14151411
TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\";
1412+
PLATFORM_ROOT = "$($HostArch.PlatformInstallRoot)\";
1413+
# Pending support for building other architectures
1414+
SDK_ROOT = "$($HostArch.SDKInstallRoot)\";
14161415
INCLUDE_SWIFT_FORMAT = "true";
14171416
SWIFT_FORMAT_BUILD = "$($HostArch.BinaryCache)\swift-format\release";
1418-
}
1419-
1420-
Build-WiXProject dbg\dbg.wixproj -Arch $HostArch -Properties @{
1421-
DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\";
1422-
TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\";
14231417
INCLUDE_SWIFT_INSPECT = "true";
14241418
SWIFT_INSPECT_BUILD = "$($HostArch.BinaryCache)\swift-inspect\release";
14251419
}
14261420

1427-
Build-WiXProject ide\ide.wixproj -Arch $HostArch -Properties @{
1428-
DEVTOOLS_ROOT = "$($HostArch.ToolchainInstallRoot)\";
1429-
TOOLCHAIN_ROOT = "$($HostArch.ToolchainInstallRoot)\";
1430-
}
1421+
if (($Stage -ne "") -and (-not $ToBatch)) {
1422+
$Stage += "\" # Interpret as target directory
14311423

1432-
foreach ($Arch in $SDKArchs) {
1433-
Build-WiXProject runtimemsi\runtimemsi.wixproj -Arch $Arch -Properties @{
1434-
SDK_ROOT = "$($Arch.SDKInstallRoot)\";
1435-
}
1436-
1437-
Build-WiXProject sdk\sdk.wixproj -Arch $Arch -Properties @{
1438-
InstallerPlatform = $HostArch.ShortName;
1439-
PLATFORM_ROOT = "$($Arch.PlatformInstallRoot)\";
1440-
SDK_ROOT = "$($Arch.SDKInstallRoot)\";
1441-
SWIFT_SOURCE_DIR = "$SourceCache\swift\";
1442-
}
1443-
}
1444-
1445-
foreach ($MSI in ("bld", "cli", "dbg", "ide", "sdk", "runtime")) {
1446-
if ($ToBatch) {
1447-
Write-Output "Move-Item $($HostArch.BinaryCache)\msi\Release\$($HostArch.VSName)\$MSI.msi $($HostArch.BinaryCache)\msi\";
1448-
} else {
1449-
Move-Item -Force "$($HostArch.BinaryCache)\msi\Release\$($HostArch.VSName)\$MSI.msi" "$($HostArch.BinaryCache)\msi\";
1450-
}
1451-
}
1452-
1453-
Build-WiXProject bundle\installer.wixproj -Arch $HostArch -Bundle -Properties @{
1454-
MSI_LOCATION = "$($HostArch.BinaryCache)\msi\";
1424+
Copy-File "$($HostArch.BinaryCache)\installer\Release\$($HostArch.VSName)\*.msi" $Stage
1425+
Copy-File "$($HostArch.BinaryCache)\installer\Release\$($HostArch.VSName)\installer.exe" $Stage
14551426
}
14561427
}
14571428

@@ -1462,7 +1433,6 @@ if (-not $SkipBuild) {
14621433
Build-Compilers $HostArch
14631434
}
14641435

1465-
14661436
foreach ($Arch in $SDKArchs) {
14671437
if (-not $SkipBuild) {
14681438
Build-ZLib $Arch
@@ -1526,10 +1496,3 @@ if ($Test -contains "dispatch") { Build-Dispatch $HostArch -Test }
15261496
if ($Test -contains "foundation") { Build-Foundation $HostArch -Test }
15271497
if ($Test -contains "xctest") { Build-XCTest $HostArch -Test }
15281498
if ($Test -contains "llbuild") { Build-LLBuild $HostArch -Test }
1529-
1530-
if (-not $SkipPackaging -and $Stage -ne "") {
1531-
$Stage += "\" # Interpret as target directory
1532-
1533-
Copy-File "$($HostArch.BinaryCache)\msi\*.msi" $Stage
1534-
Copy-File "$($HostArch.BinaryCache)\installer.exe" $Stage
1535-
}

0 commit comments

Comments
 (0)