Skip to content

Commit 43e4733

Browse files
authored
Three ZipBuilder Fixes (#5341)
1 parent 4265573 commit 43e4733

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

ZipBuilder/Sources/ZipBuilder/CocoaPodUtils.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,15 @@ enum CocoaPodUtils {
327327
in installedPods: [String: PodInfo])
328328
-> [VersionedPod] {
329329
return transitivePodDependencies(for: podName, in: installedPods).map {
330-
CocoaPodUtils.VersionedPod(name: $0, version: installedPods[$0]?.version)
330+
var podVersion: String?
331+
if let version = installedPods[$0]?.version {
332+
podVersion = version
333+
} else {
334+
// See if there's a version on the base pod.
335+
let basePod = String($0.split(separator: "/")[0])
336+
podVersion = installedPods[basePod]?.version
337+
}
338+
return CocoaPodUtils.VersionedPod(name: $0, version: podVersion)
331339
}
332340
}
333341

@@ -406,10 +414,11 @@ enum CocoaPodUtils {
406414
// Loop through the subspecs passed in and use the actual Pod name.
407415
for pod in pods {
408416
podfile += " pod '\(pod.name)'"
417+
let podspec = String(pod.name.split(separator: "/")[0] + ".podspec")
409418
// Check if we want to use a local version of the podspec.
410419
if let localURL = LaunchArgs.shared.localPodspecPath,
411420
FileManager.default
412-
.fileExists(atPath: localURL.appendingPathComponent(pod.name + ".podspec").path) {
421+
.fileExists(atPath: localURL.appendingPathComponent(podspec).path) {
413422
podfile += ", :path => '\(localURL.path)'"
414423
} else if let podVersion = pod.version {
415424
podfile += ", '\(podVersion)'"

ZipBuilder/Sources/ZipBuilder/LaunchArgs.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,11 @@ struct LaunchArgs {
350350
updatePodRepo = defaults.bool(forKey: Key.updatePodRepo.rawValue)
351351
keepBuildArtifacts = defaults.bool(forKey: Key.keepBuildArtifacts.rawValue)
352352

353+
if !buildDependencies && zipPods == nil {
354+
LaunchArgs.exitWithUsageAndLog("The -buildDependencies option cannot be false unless a " +
355+
"list of pods is specified with the -zipPods option.")
356+
}
357+
353358
// Check for extra invalid options.
354359
let validArgs = Key.allCases.map { $0.rawValue }
355360
for arg in ProcessInfo.processInfo.arguments {

ZipBuilder/Sources/ZipBuilder/ZipBuilder.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ struct ZipBuilder {
382382
// Keep track of the names of the frameworks copied over.
383383
var copiedFrameworkNames: [String] = []
384384

385-
// Loop through each InstalledPod item and get the name so we can fetch the framework and copy
385+
// Loop through each installedPod item and get the name so we can fetch the framework and copy
386386
// it to the destination directory.
387387
for podName in installedPods {
388388
// Skip the Firebase pod, any Interop pods, and specifically ignored frameworks.

0 commit comments

Comments
 (0)