@@ -114,7 +114,11 @@ struct ZipBuilderTool: ParsableCommand {
114
114
""" ) )
115
115
var platforms : [ TargetPlatform ]
116
116
117
- // MARK: - Zip Pods
117
+ // MARK: - Specify Pods
118
+
119
+ @Option ( parsing: . upToNextOption,
120
+ help: ArgumentHelp ( " List of pods to build. " ) )
121
+ var pods : [ String ]
118
122
119
123
@Option ( help: ArgumentHelp ( """
120
124
The path to a JSON file of the pods (with optional version) to package into a zip.
@@ -246,11 +250,20 @@ struct ZipBuilderTool: ParsableCommand {
246
250
}
247
251
}
248
252
249
- if let zipPods = zipPods {
250
- let ( installedPods, frameworks, _) = builder. buildAndAssembleZip ( podsToInstall: zipPods,
251
- inProjectDir: projectDir,
252
- minimumIOSVersion: minimumIOSVersion,
253
- includeDependencies: buildDependencies)
253
+ var podsToBuild = zipPods
254
+ if pods. count > 0 {
255
+ guard podsToBuild == nil else {
256
+ fatalError ( " Only one of `--zipPods` or `--pods` can be specified. " )
257
+ }
258
+ podsToBuild = pods. map { CocoaPodUtils . VersionedPod ( name: $0, version: nil ) }
259
+ }
260
+
261
+ if let podsToBuild = podsToBuild {
262
+ let ( installedPods, frameworks, _) =
263
+ builder. buildAndAssembleZip ( podsToInstall: podsToBuild,
264
+ inProjectDir: projectDir,
265
+ minimumIOSVersion: minimumIOSVersion,
266
+ includeDependencies: buildDependencies)
254
267
let staging = FileManager . default. temporaryDirectory ( withName: " staging " )
255
268
try builder. copyFrameworks ( fromPods: Array ( installedPods. keys) , toDirectory: staging,
256
269
frameworkLocations: frameworks)
0 commit comments