Skip to content

Commit 3c153b6

Browse files
authored
[CocoaPods] Lock FirestoreInternal version to Firestore (#12654)
1 parent 8230f73 commit 3c153b6

File tree

2 files changed

+22
-11
lines changed

2 files changed

+22
-11
lines changed

FirebaseFirestore.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Google Cloud Firestore is a NoSQL document database built for automatic scaling,
3737

3838
s.dependency 'FirebaseCore', '~> 10.0'
3939
s.dependency 'FirebaseCoreExtension', '~> 10.0'
40-
s.dependency 'FirebaseFirestoreInternal', '~> 10.17'
40+
s.dependency 'FirebaseFirestoreInternal', '10.24.0'
4141
s.dependency 'FirebaseSharedSwift', '~> 10.0'
4242

4343
end

ReleaseTooling/Sources/FirebaseReleaser/InitializeRelease.swift

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,20 +48,31 @@ enum InitializeRelease {
4848
if pod.name == "Firebase" {
4949
updateFirebasePodspec(path: path, manifest: manifest)
5050
} else {
51-
let scripts: String = [
52-
// Pods depending on GoogleAppMeasurement specs should pin the
53-
// dependency to the new version.
54-
#"-e "s|(\.dependency 'GoogleAppMeasurement/?.*',).*|\1 '\#(version)'|""#,
55-
// Replace the pod's `version` attribute with the new version.
56-
#"-e "s|(\.version.*=[[:space:]]*) '.*|\1 '\#(version)'|""#,
57-
].joined(separator: " ")
58-
59-
let command = "sed -i.bak -E \(scripts) \(pod.podspecName())"
60-
Shell.executeCommand(command, workingDir: path)
51+
// Pods depending on GoogleAppMeasurement and FirebaseFirestoreInternal specs
52+
// should pin the dependency to the new version.
53+
for dep in ["GoogleAppMeasurement", "FirebaseFirestoreInternal"] {
54+
updateDependenciesToLatest(dependency: dep, pod: pod, version: version, path: path)
55+
}
6156
}
6257
}
6358
}
6459

60+
/// Pods depending on GoogleAppMeasurement and FirebaseFirestoreInternal specs
61+
/// should pin the dependency to the new version.
62+
private static func updateDependenciesToLatest(dependency: String,
63+
pod: Pod,
64+
version: String,
65+
path: URL) {
66+
let scripts: String = [
67+
#"-e "s|(\.dependency '"# + dependency + #"/?.*',).*|\1 '\#(version)'|""#,
68+
// Replace the pod's `version` attribute with the new version.
69+
#"-e "s|(\.version.*=[[:space:]]*) '.*|\1 '\#(version)'|""#,
70+
].joined(separator: " ")
71+
72+
let command = "sed -i.bak -E \(scripts) \(pod.podspecName())"
73+
Shell.executeCommand(command, workingDir: path)
74+
}
75+
6576
// This function patches the versions in the Firebase.podspec. It uses Swift instead of sed
6677
// like the other version patching.
6778
// TODO: Choose one or the other mechanism.

0 commit comments

Comments
 (0)