Skip to content

Commit f5068f5

Browse files
committed
remove duplicate library linking in podfile
1 parent 4c9b0eb commit f5068f5

File tree

3 files changed

+44
-6
lines changed

3 files changed

+44
-6
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@ project Podfile
6363
```ruby
6464
pod 'Firebase', '6.33.0'
6565
pod 'FirebaseCrashlytics', '4.6.1'
66+
67+
# Firebase libraries already linked in moko-crash-reporting. Remove duplicated linking.
68+
post_install do |installer|
69+
host_targets = installer.aggregate_targets.select { |aggregate_target|
70+
aggregate_target.name.include? "Pods-"
71+
}
72+
73+
host_targets.each do |host_target|
74+
host_target.xcconfigs.each do |config_name, config_file|
75+
config_file.frameworks.delete("FirebaseCore")
76+
config_file.frameworks.delete("FirebaseCrashlytics")
77+
config_file.frameworks.delete("FirebaseInstallations")
78+
config_file.frameworks.delete("GoogleDataTransport")
79+
80+
xcconfig_path = host_target.xcconfig_path(config_name)
81+
config_file.save_as(xcconfig_path)
82+
end
83+
end
84+
end
6685
```
6786
## Usage
6887

sample/ios-app/Podfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,23 @@ target 'TestProj' do
1414
pod 'MultiPlatformLibrary', :path => '../mpp-library'
1515
pod 'Firebase', '6.33.0'
1616
pod 'FirebaseCrashlytics', '4.6.1'
17+
18+
# Firebase libraries already linked in moko-crash-reporting. Remove duplicated linking.
19+
post_install do |installer|
20+
host_targets = installer.aggregate_targets.select { |aggregate_target|
21+
aggregate_target.name.include? "Pods-"
22+
}
23+
24+
host_targets.each do |host_target|
25+
host_target.xcconfigs.each do |config_name, config_file|
26+
config_file.frameworks.delete("FirebaseCore")
27+
config_file.frameworks.delete("FirebaseCrashlytics")
28+
config_file.frameworks.delete("FirebaseInstallations")
29+
config_file.frameworks.delete("GoogleDataTransport")
30+
31+
xcconfig_path = host_target.xcconfig_path(config_name)
32+
config_file.save_as(xcconfig_path)
33+
end
34+
end
35+
end
1736
end

sample/ios-app/Podfile.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ PODS:
4141
- GoogleUtilities/Network (~> 6.7)
4242
- "GoogleUtilities/NSData+zlib (~> 6.7)"
4343
- nanopb (~> 1.30906.0)
44-
- GoogleDataTransport (7.4.0):
44+
- GoogleDataTransport (7.5.1):
4545
- nanopb (~> 1.30906.0)
4646
- GoogleUtilities/AppDelegateSwizzler (6.7.2):
4747
- GoogleUtilities/Environment
@@ -68,11 +68,11 @@ PODS:
6868
- nanopb/encode (= 1.30906.0)
6969
- nanopb/decode (1.30906.0)
7070
- nanopb/encode (1.30906.0)
71-
- PromisesObjC (1.2.10)
71+
- PromisesObjC (1.2.11)
7272

7373
DEPENDENCIES:
7474
- Firebase (= 6.33.0)
75-
- FirebaseCrashlytics
75+
- FirebaseCrashlytics (= 4.6.1)
7676
- MultiPlatformLibrary (from `../mpp-library`)
7777

7878
SPEC REPOS:
@@ -101,12 +101,12 @@ SPEC CHECKSUMS:
101101
FirebaseCrashlytics: 5777d3462fb8c3ab9e80a2473bd7d667a2e8411c
102102
FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2
103103
GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436
104-
GoogleDataTransport: b7f406340a291370045a270c599e53c6fa6ec20f
104+
GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833
105105
GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3
106106
MultiPlatformLibrary: 176fb8ade516666cd47e93de1b71ba0441a541bb
107107
nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc
108-
PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151
108+
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
109109

110-
PODFILE CHECKSUM: cda8a19268eedbd8de1aa68cc1eba57c7ea56ffb
110+
PODFILE CHECKSUM: 2970c0b3f8e435e7af3f0ed0ce420e36de247e27
111111

112112
COCOAPODS: 1.9.3

0 commit comments

Comments
 (0)