Browse Source

updated README about linking with use_frameworks #344

Dmitriy Grachev 5 years ago
parent
commit
9db57a1246
1 changed files with 25 additions and 0 deletions
  1. 25
    0
      README.md

+ 25
- 0
README.md View File

27
 
27
 
28
 By default no permission handler is installed. Update your `Podfile` by choosing the ones you want to check or request, then run `pod install`.
28
 By default no permission handler is installed. Update your `Podfile` by choosing the ones you want to check or request, then run `pod install`.
29
 
29
 
30
+```ruby
31
+# if you have prebuild dynamic cocoapods dependencies and could not migrate
32
+# to use_modular_headers you should use workaround for linking app with dynamic frameworks
33
+# and with static libraries by placing this code at the top of Podfile
34
+# 
35
+# Add this code at the top of Podfile right after platform definition
36
+use_frameworks!
37
+
38
+dynamic_frameworks = ['RxCocoa', 'RxSwift', 'WhatEverSDKName']
39
+
40
+# make all the other dependencies into static libraries by overriding the static_library
41
+pre_install do |installer|
42
+    installer.pod_targets.each do |pod|
43
+        if !dynamic_frameworks.include?(pod.name)
44
+            puts "Overriding the static_library for #{pod.name}"
45
+            def pod.build_type;
46
+              Pod::Target::BuildType.static_library
47
+              # for static framework -
48
+              # Pod::Target::BuildType.static_framework
49
+            end
50
+        end
51
+    end
52
+end
53
+```
54
+
30
 ```ruby
55
 ```ruby
31
 # 🚨 If you use use_framework! 🚨
56
 # 🚨 If you use use_framework! 🚨
32
 # - Ensure that you have installed at least Cocoapods 1.5.0
57
 # - Ensure that you have installed at least Cocoapods 1.5.0