Skip to content

Commit 662a8d6

Browse files
authored
Add a flag to skip building for Catalyst (#7220)
1 parent 0d24059 commit 662a8d6

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

ReleaseTooling/Sources/ZipBuilder/Platform.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ enum Platform: CaseIterable {
2424

2525
var platformTargets: [TargetPlatform] {
2626
switch self {
27-
case .iOS: return [.iOSDevice, .iOSSimulator, .catalyst]
27+
case .iOS: return [.iOSDevice, .iOSSimulator] + (SkipCatalyst.skip ? [] : [.catalyst])
2828
case .macOS: return [.macOS]
2929
case .tvOS: return [.tvOSDevice, .tvOSSimulator]
3030
}
@@ -59,3 +59,10 @@ class PlatformMinimum {
5959
minimumTVOSVersion = tvos
6060
}
6161
}
62+
63+
class SkipCatalyst {
64+
fileprivate static var skip = false
65+
static func set() {
66+
skip = true
67+
}
68+
}

ReleaseTooling/Sources/ZipBuilder/main.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ struct ZipBuilderTool: ParsableCommand {
7979
help: ArgumentHelp("A flag to indicate keeping (not deleting) the build artifacts."))
8080
var keepBuildArtifacts: Bool
8181

82+
/// Flag to skip building the Catalyst slices.
83+
@Flag(default: false,
84+
inversion: .prefixedNo,
85+
help: ArgumentHelp("A flag to indicate keeping (not deleting) the build artifacts."))
86+
var skipCatalyst: Bool
87+
8288
/// Flag to run `pod repo update` and `pod cache clean --all`.
8389
@Flag(default: true,
8490
inversion: .prefixedNo,
@@ -232,6 +238,11 @@ struct ZipBuilderTool: ParsableCommand {
232238
macos: minimumMACOSVersion,
233239
tvos: minimumTVOSVersion)
234240

241+
// Update iOS target platforms if `--skip-catalyst` was specified.
242+
if skipCatalyst {
243+
SkipCatalyst.set()
244+
}
245+
235246
let paths = ZipBuilder.FilesystemPaths(repoDir: repoDir,
236247
buildRoot: buildRoot,
237248
outputDir: outputDir,

0 commit comments

Comments
 (0)