Skip to content

Commit 5bbead3

Browse files
authored
Merge pull request #70962 from compnerd/squeaky-clean
build: add a `-Clean` option to build.ps1
2 parents ed7ed2d + 9e41534 commit 5bbead3

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

utils/build.ps1

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ If set, debug information will be generated for the builds.
6262
.PARAMETER EnableCaching
6363
If true, use `sccache` to cache the build rules.
6464
65+
.PARAMETER Clean
66+
If true, clean non-compiler builds while building.
67+
6568
.PARAMETER Test
6669
An array of names of projects to run tests for.
6770
'*' runs all tests
@@ -101,6 +104,7 @@ param(
101104
[string[]] $Test = @(),
102105
[string] $Stage = "",
103106
[string] $BuildTo = "",
107+
[switch] $Clean,
104108
[switch] $DebugInfo,
105109
[switch] $EnableCaching,
106110
[switch] $ToBatch
@@ -1161,7 +1165,6 @@ function Build-Runtime($Arch) {
11611165
SWIFT_NATIVE_SWIFT_TOOLS_PATH = "$BinaryCache\1\bin";
11621166
SWIFT_PATH_TO_LIBDISPATCH_SOURCE = "$SourceCache\swift-corelibs-libdispatch";
11631167
SWIFT_PATH_TO_STRING_PROCESSING_SOURCE = "$SourceCache\swift-experimental-string-processing";
1164-
SWIFT_PATH_TO_SWIFT_SYNTAX_SOURCE = "$SourceCache\swift-syntax";
11651168
CMAKE_SHARED_LINKER_FLAGS = @("/INCREMENTAL:NO", "/OPT:REF", "/OPT:ICF");
11661169
}
11671170
}
@@ -1743,6 +1746,13 @@ if (-not $SkipBuild) {
17431746
Invoke-BuildStep Build-Compilers $HostArch
17441747
}
17451748

1749+
if ($Clean) {
1750+
2..16 | % { Remove-Item -Force -Recurse "$BinaryCache\$_" -ErrorAction Ignore }
1751+
foreach ($Arch in $SDKArchs) {
1752+
0..3 | % { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildiD + $_)" -ErrorAction Ignore }
1753+
}
1754+
}
1755+
17461756
foreach ($Arch in $SDKArchs) {
17471757
if (-not $SkipBuild) {
17481758
Invoke-BuildStep Build-ZLib $Arch

0 commit comments

Comments
 (0)