@@ -482,16 +482,11 @@ enum CocoaPodUtils {
482
482
for pod in pods {
483
483
let rootPod = String ( pod. name. split ( separator: " / " ) . first!)
484
484
485
- let podIsClosedSource : Bool = FirebaseManifest . shared. pods
486
- . filter ( \. isClosedSource)
487
- . map ( \. name)
488
- . contains ( rootPod)
489
-
490
485
// Check if we want to use a local version of the podspec.
491
- if !podIsClosedSource ,
492
- let localURL = localPodspecPath,
493
- FileManager . default
494
- . fileExists ( atPath : localURL . appendingPathComponent ( " \( rootPod ) .podspec " ) . path ) {
486
+ if let localURL = localPodspecPath ,
487
+ let pathURL = localPodspecPath? . appendingPathComponent ( " \( rootPod ) .podspec " ) . path ,
488
+ FileManager . default. fileExists ( atPath : pathURL ) ,
489
+ isSourcePodspec ( pathURL ) {
495
490
podfile += " pod ' \( pod. name) ', :path => ' \( localURL. path) ' "
496
491
} else if let podVersion = pod. version {
497
492
// To support Firebase patch versions in the Firebase zip distribution, allow patch updates
@@ -553,6 +548,16 @@ enum CocoaPodUtils {
553
548
return podfile
554
549
}
555
550
551
+ private static func isSourcePodspec( _ podspecPath: String ) -> Bool {
552
+ do {
553
+ let contents = try String ( contentsOfFile: podspecPath, encoding: . utf8)
554
+ // The presence of ".vendored_frameworks" in a podspec indicates a binary pod.
555
+ return contents. range ( of: " .vendored_frameworks " ) == nil
556
+ } catch {
557
+ fatalError ( " Could not read \( podspecPath) : \( error) " )
558
+ }
559
+ }
560
+
556
561
/// Write a podfile that contains all the pods passed in to the directory passed in with a name
557
562
/// "Podfile".
558
563
private static func writePodfile( for pods: [ VersionedPod ] ,
0 commit comments