Skip to content

Commit e799928

Browse files
authored
Remove deprecated ML pods from Zip and docs (#6061)
1 parent 69c3e4b commit e799928

File tree

4 files changed

+5
-71
lines changed

4 files changed

+5
-71
lines changed

Carthage.md

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,7 @@ binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseGoogleSignInBinar
4747
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseInAppMessagingBinary.json"
4848
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMessagingBinary.json"
4949
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLModelInterpreterBinary.json"
50-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLNLLanguageIDBinary.json"
51-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLNLSmartReplyBinary.json"
52-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLNLTranslateBinary.json"
53-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLNaturalLanguageBinary.json"
54-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionAutoMLBinary.json"
55-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionBarcodeModelBinary.json"
5650
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionBinary.json"
57-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionFaceModelBinary.json"
58-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionLabelModelBinary.json"
59-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionObjectDetectionBinary.json"
60-
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseMLVisionTextModelBinary.json"
6151
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebasePerformanceBinary.json"
6252
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseProtobufBinary.json"
6353
binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseRemoteConfigBinary.json"
@@ -73,11 +63,7 @@ binary "https://dl.google.com/dl/firebase/ios/carthage/FirebaseStorageBinary.jso
7363
- [Delete Firebase.framework from the Link Binary With Libraries Build Phase](https://github.com/firebase/firebase-ios-sdk/issues/911#issuecomment-372455235).
7464
- If you're including a Firebase component that has resources, copy its bundles
7565
into the Xcode project and make sure they're added to the
76-
`Copy Bundle Resources` Build Phase :
77-
- For FirebaseMLVisionFaceModel:
78-
- ./Carthage/Build/iOS/FaceDetector.framework/GoogleMVFaceDetectorResources.bundle
79-
- For FirebaseMLVisionTextModel:
80-
- ./Carthage/Build/iOS/TextDetector.framework/GoogleMVTextDetectorResources.bundle
66+
`Copy Bundle Resources` Build Phase.
8167

8268
- Please note that you shouldn't add any of the Firebase frameworks to the Carthage build phase
8369
(`copy-frameworks`). The frameworks contain static libraries that are linked at build time.

Rome.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ Then do the following steps:
5252
`file Rome/*/* | grep universal | grep dynamic`
5353
1. Drag each dynamic framework to the "Embed Frameworks" section on the
5454
Xcode Build Target's "General" page.
55-
1. If you're using FirebaseML, FirebaseInAppMessaging, or FirebaseFirestore,
56-
find
57-
the resources to the project: `ls -ld Pods/*/Resources/*`. More details on
58-
this below.
55+
1. If you're using FirebaseInAppMessaging, find the resources needed:
56+
`ls -ld Pods/*/Resources/*`. More details on this below.
5957
1. Drag all of those resources into the Project Navigator, just
6058
like the frameworks, again making sure that the target you want to add these
6159
resources to has a checkmark next to it, and that you've selected "Copy items
@@ -81,13 +79,5 @@ Then do the following steps:
8179
- If you're including a Firebase component that has resources, copy its bundles
8280
into the Xcode project and make sure they're added to the
8381
`Copy Bundle Resources` Build Phase :
84-
- For Firestore:
85-
- ./Rome/GRPCClient.framework/gRPCCertificates.bundle
8682
- For InAppMessaging:
8783
- ./Rome/FirebaseInAppMessaging.framework/InAppMessagingDisplayResources.bundle
88-
- For FirebaseMLVisionFaceModel:
89-
- ./Pods/GoogleMobileVision/FaceDetector/Resources/GoogleMVFaceDetectorResources
90-
- For FirebaseMLVisionTextModel:
91-
- ./Pods/GoogleMobileVision/TextDetector/Resources/GoogleMVTextDetectorResources
92-
- For the FirebaseML resources, a bundle needs to be created. TBD better
93-
instructions here.

ZipBuilder/Sources/ZipBuilder/FirebasePods.swift

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,11 @@ enum FirebasePods: String, CaseIterable {
3434
case inAppMessaging = "FirebaseInAppMessaging"
3535
case messaging = "FirebaseMessaging"
3636
case mlModelInterpreter = "FirebaseMLModelInterpreter"
37-
case mlNaturalLanguage = "FirebaseMLNaturalLanguage"
38-
case mlNLLanguageID = "FirebaseMLNLLanguageID"
39-
case mlNLSmartReply = "FirebaseMLNLSmartReply"
40-
case mlNLTranslate = "FirebaseMLNLTranslate"
4137
case mlVision = "FirebaseMLVision"
42-
case mlVisionAutoML = "FirebaseMLVisionAutoML"
43-
case mlVisionObjectDetection = "FirebaseMLVisionObjectDetection"
44-
case mlVisionBarcodeModel = "FirebaseMLVisionBarcodeModel"
45-
case mlVisionFaceModel = "FirebaseMLVisionFaceModel"
46-
case mlVisionLabelModel = "FirebaseMLVisionLabelModel"
47-
case mlVisionTextModel = "FirebaseMLVisionTextModel"
4838
case performance = "FirebasePerformance"
4939
case remoteConfig = "FirebaseRemoteConfig"
5040
case storage = "FirebaseStorage"
5141

52-
/// Flag to explicitly exclude any Resources from being copied.
53-
var excludeResources: Bool {
54-
switch self {
55-
case .mlVision, .mlVisionBarcodeModel, .mlVisionLabelModel:
56-
return true
57-
default:
58-
return false
59-
}
60-
}
61-
6242
/// Describes the dependency on other frameworks for the README file.
6343
static func readmeHeader(podName: String) -> String {
6444
var header = "## \(podName)"
@@ -68,19 +48,4 @@ enum FirebasePods: String, CaseIterable {
6848
header += "\n"
6949
return header
7050
}
71-
72-
// TODO: Evaluate if there's a way to do this that doesn't require the hardcoded values to be
73-
// maintained. Likely looking at the `vendored_frameworks` from each Pod's Podspec.
74-
/// Returns folders to remove from the Zip file from a specific pod for de-duplication. This
75-
/// is necessary for the MLKit frameworks because of their unique structure, an unnecessary amount
76-
/// of frameworks get pulled in.
77-
static func duplicateFrameworksToRemove(pod: String) -> [String] {
78-
switch pod {
79-
case "FirebaseMLVisionBarcodeModel", "FirebaseMLVisionFaceModel", "FirebaseMLVisionLabelModel",
80-
"FirebaseMLVisionTextModel":
81-
return ["GTMSessionFetcher.framework", "Protobuf.framework"]
82-
default:
83-
return []
84-
}
85-
}
8651
}

ZipBuilder/Sources/ZipBuilder/ZipBuilder.swift

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,8 +374,7 @@ struct ZipBuilder {
374374
func copyFrameworks(fromPods installedPods: [String],
375375
toDirectory dir: URL,
376376
frameworkLocations: [String: [URL]],
377-
podsToIgnore: [String] = [],
378-
foldersToIgnore: [String] = []) throws -> [String] {
377+
podsToIgnore: [String] = []) throws -> [String] {
379378
let fileManager = FileManager.default
380379
if !fileManager.directoryExists(at: dir) {
381380
try fileManager.createDirectory(at: dir, withIntermediateDirectories: false, attributes: nil)
@@ -405,10 +404,6 @@ struct ZipBuilder {
405404
// Copy each of the frameworks over, unless it's explicitly ignored.
406405
for xcframework in xcframeworks {
407406
let xcframeworkName = xcframework.lastPathComponent
408-
if foldersToIgnore.contains(xcframeworkName) {
409-
continue
410-
}
411-
412407
let destination = dir.appendingPathComponent(xcframeworkName)
413408
try fileManager.copyItem(at: xcframework, to: destination)
414409
copiedFrameworkNames
@@ -553,9 +548,7 @@ struct ZipBuilder {
553548
let namedFrameworks = try copyFrameworks(fromPods: podsToCopy,
554549
toDirectory: productDir,
555550
frameworkLocations: builtFrameworks,
556-
podsToIgnore: podsToIgnore,
557-
foldersToIgnore: FirebasePods
558-
.duplicateFrameworksToRemove(pod: podName))
551+
podsToIgnore: podsToIgnore)
559552

560553
let copiedFrameworks = namedFrameworks.filter {
561554
// Skip frameworks that aren't contained in the "podsToIgnore" array and the Firebase pod.

0 commit comments

Comments
 (0)