Skip to content

Commit 4824fb0

Browse files
committed
Made Firebase 7.0 RC0 here
1 parent 6653bb3 commit 4824fb0

File tree

4 files changed

+52
-23
lines changed

4 files changed

+52
-23
lines changed

ZipBuilder/Sources/FirebaseManifest/FirebaseManifest.swift

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,35 +20,35 @@ import Foundation
2020
/// Version should be updated every release.
2121
/// The version and releasing fields of the non-Firebase pods should be reviewed every release.
2222
public let shared = Manifest(
23-
version: "6.99.0",
23+
version: "7.0.0",
2424
pods: [
25-
Pod("GoogleUtilities", isFirebase: false, podVersion: "6.99.9999", releasing: true),
26-
Pod("GoogleDataTransport", isFirebase: false, podVersion: "6.999.990", releasing: true),
25+
Pod("GoogleUtilities", isFirebase: false, podVersion: "7.0.0", releasing: false),
26+
Pod("GoogleDataTransport", isFirebase: false, podVersion: "8.0.0", releasing: true),
2727

2828
Pod("FirebaseCoreDiagnostics"),
2929
Pod("FirebaseCore"),
3030
Pod("FirebaseInstallations"),
3131
Pod("FirebaseInstanceID"),
32-
Pod("FirebaseAnalytics", isClosedSource: true),
3332
Pod("GoogleAppMeasurement", isClosedSource: true),
33+
Pod("FirebaseAnalytics", isClosedSource: true),
3434
Pod("FirebaseABTesting"),
35-
Pod("FirebaseAppDistribution"),
35+
Pod("FirebaseAppDistribution", isBeta: true),
3636
Pod("FirebaseAuth"),
3737
Pod("FirebaseCrashlytics"),
3838
Pod("FirebaseDatabase"),
3939
Pod("FirebaseDynamicLinks"),
4040
Pod("FirebaseFirestore", allowWarnings: true),
41-
Pod("FirebaseFirestoreSwift"),
41+
Pod("FirebaseFirestoreSwift", isBeta: true),
4242
Pod("FirebaseFunctions"),
43-
Pod("FirebaseInAppMessaging"),
43+
Pod("FirebaseInAppMessaging", isBeta: true),
4444
Pod("FirebaseMessaging"),
45-
Pod("FirebasePerformance"),
45+
Pod("FirebasePerformance", isClosedSource: true),
4646
Pod("FirebaseRemoteConfig"),
4747
Pod("FirebaseStorage"),
48-
Pod("FirebaseStorageSwift"),
49-
Pod("FirebaseMLCommon", isClosedSource: true),
50-
Pod("FirebaseMLModelInterpreter", isClosedSource: true),
51-
Pod("FirebaseMLVision", isClosedSource: true),
48+
Pod("FirebaseStorageSwift", isBeta: true),
49+
Pod("FirebaseMLCommon", isClosedSource: true, isBeta: true),
50+
Pod("FirebaseMLModelInterpreter", isClosedSource: true, isBeta: true),
51+
Pod("FirebaseMLVision", isClosedSource: true, isBeta: true),
5252
Pod("Firebase", allowWarnings: true),
5353
]
5454
)
@@ -63,19 +63,22 @@ public struct Manifest {
6363
public struct Pod {
6464
public let name: String
6565
public let isClosedSource: Bool
66+
public let isBeta: Bool
6667
public let isFirebase: Bool
6768
public let allowWarnings: Bool // Allow validation warnings. Ideally these should all be false
6869
public let podVersion: String? // Non-Firebase pods have their own version
6970
public let releasing: Bool // Non-Firebase pods may not release
7071

7172
init(_ name: String,
7273
isClosedSource: Bool = false,
74+
isBeta: Bool = false,
7375
isFirebase: Bool = true,
7476
allowWarnings: Bool = false,
7577
podVersion: String? = nil,
7678
releasing: Bool = true) {
7779
self.name = name
7880
self.isClosedSource = isClosedSource
81+
self.isBeta = isBeta
7982
self.isFirebase = isFirebase
8083
self.allowWarnings = allowWarnings
8184
self.podVersion = podVersion
@@ -85,4 +88,13 @@ public struct Pod {
8588
public func podspecName() -> String {
8689
return isClosedSource ? "\(name).podspec.json" : "\(name).podspec"
8790
}
91+
92+
/// Closed source pods do not validate on Xcode 12 until they support the ARM simulator slice.
93+
public func skipImportValidation() -> String {
94+
if isClosedSource || name == "Firebase" {
95+
return "-skip-import-validation"
96+
} else {
97+
return ""
98+
}
99+
}
88100
}

ZipBuilder/Sources/FirebaseReleaser/InitializeRelease.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,24 @@ import FirebaseManifest
2020
import Utils
2121

2222
struct InitializeRelease {
23-
static func setupRepo(gitRoot: URL) {
23+
static func setupRepo(gitRoot: URL) -> String {
2424
let manifest = FirebaseManifest.shared
25-
createReleaseBranch(path: gitRoot, version: manifest.version)
25+
let branch = createReleaseBranch(path: gitRoot, version: manifest.version)
2626
updatePodspecs(path: gitRoot, manifest: manifest)
2727
updatePodfiles(path: gitRoot, version: manifest.version)
28+
return branch
2829
}
2930

3031
/// The branch is based on the minor version to represent this is the branch for subsequent
3132
/// patches.
32-
private static func createReleaseBranch(path: URL, version: String) {
33+
private static func createReleaseBranch(path: URL, version: String) -> String {
3334
let versionParts = version.split(separator: ".")
3435
let minorVersion = "\(versionParts[0]).\(versionParts[1])"
3536
let branch = "release-\(minorVersion)"
3637
Shell.executeCommand("git checkout master", workingDir: path)
3738
Shell.executeCommand("git pull", workingDir: path)
3839
Shell.executeCommand("git checkout -b \(branch)", workingDir: path)
40+
return branch
3941
}
4042

4143
/// Update the podspec versions.
@@ -45,10 +47,10 @@ struct InitializeRelease {
4547
if pod.name == "Firebase" {
4648
updateFirebasePodspec(path: path, manifest: manifest)
4749
} else {
48-
let version = pod.podVersion ?? manifest.version
50+
let version = pod.podVersion ??
51+
(pod.isBeta ? manifest.version + "-beta" : manifest.version)
4952
Shell.executeCommand("sed -i.bak -e \"s/\\(\\.version.*=[[:space:]]*'\\).*'/\\1" +
50-
"\(version)'/\" \(pod.name).podspec",
51-
workingDir: path)
53+
"\(version)'/\" \(pod.name).podspec", workingDir: path)
5254
}
5355
}
5456
}
@@ -62,12 +64,13 @@ struct InitializeRelease {
6264
} catch {
6365
fatalError("Could not read Firebase podspec. \(error)")
6466
}
65-
let version = manifest.version
67+
let firebaseVersion = manifest.version
6668
for firebasePod in manifest.pods {
6769
if !firebasePod.isFirebase {
6870
continue
6971
}
7072
let pod = firebasePod.name
73+
let version = firebasePod.isBeta ? firebaseVersion + "-beta" : firebaseVersion
7174
if pod == "Firebase" {
7275
// Replace version in string like s.version = '6.9.0'
7376
guard let range = contents.range(of: "s.version") else {

ZipBuilder/Sources/FirebaseReleaser/Push.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import Utils
2222
struct Push {
2323
static func cpdc(gitRoot: URL) {
2424
let cpdcLocation = findCpdc(gitRoot: gitRoot)
25-
print (cpdcLocation)
26-
2725
let manifest = FirebaseManifest.shared
2826

2927
for pod in manifest.pods {
@@ -33,7 +31,8 @@ struct Push {
3331
let warningsOK = pod.allowWarnings ? " --allow-warnings" : ""
3432

3533
Shell.executeCommand("pod repo push --skip-tests --use-json \(warningsOK) \(cpdcLocation) " +
36-
"\(pod.podspecName()) --sources=sso://cpdc-internal/firebase.git,https://cdn.cocoapods.org")
34+
pod.skipImportValidation() + " \(pod.podspecName()) " + "--sources=sso://cpdc-internal/firebase.git,https://cdn.cocoapods.org",
35+
workingDir: gitRoot)
3736
}
3837
}
3938

ZipBuilder/Sources/FirebaseReleaser/main.swift

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import Foundation
1818

1919
import ArgumentParser
20+
import FirebaseManifest
2021
import Utils
2122

2223
struct FirebaseReleaser: ParsableCommand {
@@ -30,10 +31,16 @@ struct FirebaseReleaser: ParsableCommand {
3031
help: "Log without executing the shell commands")
3132
var logOnly: Bool
3233

34+
/// Set this option when starting a release.
3335
@Option(default: false,
3436
help: "Initialize the release branch")
3537
var initBranch: Bool
3638

39+
/// Set this option to update podspecs only.
40+
@Option(default: false,
41+
help: "Initialize the release branch")
42+
var pushOnly: Bool
43+
3744
mutating func validate() throws {
3845
guard FileManager.default.fileExists(atPath: gitRoot.path) else {
3946
throw ValidationError("git-root does not exist: \(gitRoot.path)")
@@ -45,9 +52,17 @@ struct FirebaseReleaser: ParsableCommand {
4552
Shell.setLogOnly()
4653
}
4754
if initBranch {
48-
InitializeRelease.setupRepo(gitRoot: gitRoot)
55+
let branch = InitializeRelease.setupRepo(gitRoot: gitRoot)
56+
let version = FirebaseManifest.shared.version
57+
Shell.executeCommand("git commit -am \"Update versions for Release \(version)\"",
58+
workingDir: gitRoot)
59+
Shell.executeCommand("git push origin \(branch)", workingDir: gitRoot)
60+
Shell.executeCommand("git branch --set-upstream-to=origin/\(branch) \(branch)",
61+
workingDir: gitRoot)
4962
Tags.create(gitRoot: gitRoot)
5063
Push.cpdc(gitRoot: gitRoot)
64+
} else if pushOnly {
65+
Push.cpdc(gitRoot: gitRoot)
5166
}
5267
}
5368

0 commit comments

Comments
 (0)