@@ -780,6 +780,7 @@ function Build-SPMProject {
780
780
[string ] $Src ,
781
781
[string ] $Bin ,
782
782
[hashtable ] $Arch ,
783
+ [switch ] $Test = $false ,
783
784
[Parameter (ValueFromRemainingArguments )]
784
785
[string []] $AdditionalArguments
785
786
)
@@ -816,7 +817,8 @@ function Build-SPMProject {
816
817
$Arguments += @ (" -debug-info-format" , " none" )
817
818
}
818
819
819
- Invoke-Program " $ToolchainInstallRoot \usr\bin\swift.exe" " build" @Arguments @AdditionalArguments
820
+ $Action = if ($Test ) { " test" } else { " build" }
821
+ Invoke-Program " $ToolchainInstallRoot \usr\bin\swift.exe" $Action @Arguments @AdditionalArguments
820
822
}
821
823
822
824
if (-not $ToBatch ) {
@@ -1601,14 +1603,14 @@ function Build-Certificates($Arch) {
1601
1603
}
1602
1604
1603
1605
function Build-PackageManager ($Arch ) {
1604
- $SrcPath = " $SourceCache \swift-package-manager"
1605
- if ( -not ( Test-Path - PathType Container $SrcPath )) {
1606
- # The Apple CI clones this repo as "swiftpm"
1607
- $SrcPath = " $SourceCache \swiftpm"
1606
+ $SrcDir = if ( Test-Path - Path " $SourceCache \swift-package-manager" - PathType Container) {
1607
+ " $SourceCache \swift-package-manager "
1608
+ } else {
1609
+ " $SourceCache \swiftpm"
1608
1610
}
1609
1611
1610
1612
Build-CMakeProject `
1611
- - Src $SrcPath `
1613
+ - Src $SrcDir `
1612
1614
- Bin $BinaryCache \12 `
1613
1615
- InstallTo " $ ( $Arch.ToolchainInstallRoot ) \usr" `
1614
1616
- Arch $Arch `
@@ -1749,6 +1751,25 @@ function Build-DocC() {
1749
1751
}
1750
1752
}
1751
1753
1754
+ function Test-PackageManager () {
1755
+ $OutDir = Join-Path - Path $HostArch.BinaryCache - ChildPath swift- package- manager
1756
+ $SrcDir = if (Test-Path - Path " $SourceCache \swift-package-manager" - PathType Container) {
1757
+ " $SourceCache \swift-package-manager"
1758
+ } else {
1759
+ " $SourceCache \swiftpm"
1760
+ }
1761
+
1762
+ Isolate- EnvVars {
1763
+ $env: SWIFTCI_USE_LOCAL_DEPS = 1
1764
+ Build-SPMProject `
1765
+ - Test `
1766
+ - Src $SrcDir `
1767
+ - Bin $OutDir `
1768
+ - Arch $HostArch `
1769
+ - Xcc - Xclang - Xcc - fno- split-cold - code - Xcc " -I$LibraryRoot \sqlite-3.43.2\usr\include" - Xlinker " -L$LibraryRoot \sqlite-3.43.2\usr\lib"
1770
+ }
1771
+ }
1772
+
1752
1773
function Build-Installer ($Arch ) {
1753
1774
$Properties = @ {
1754
1775
BundleFlavor = " offline" ;
@@ -1900,6 +1921,7 @@ if ($Test -contains "dispatch") { Build-Dispatch $HostArch -Test }
1900
1921
if ($Test -contains " foundation" ) { Build-Foundation $HostArch - Test }
1901
1922
if ($Test -contains " xctest" ) { Build-XCTest $HostArch - Test }
1902
1923
if ($Test -contains " llbuild" ) { Build-LLBuild $HostArch - Test }
1924
+ if ($Test -contains " swiftpm" ) { Test-PackageManager $HostArch }
1903
1925
1904
1926
# Custom exception printing for more detailed exception information
1905
1927
} catch {
0 commit comments