Last active
November 18, 2019 23:15
-
-
Save Dimon70007/aa97b596b480ddca7ef3e6729bb5e1a6 to your computer and use it in GitHub Desktop.
resolving static and dynamic frameworks or libraries with cocoapods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add this code at the top of Podfile | |
use_frameworks! | |
dynamic_frameworks = ['Alamofire', 'Async', 'Moya', 'Result', 'RxCocoa', 'RxSwift', 'SwiftyXMLParser', 'TrueTime'] | |
# make all the other frameworks into static frameworks by overriding the static_framework? function to return true | |
pre_install do |installer| | |
installer.pod_targets.each do |pod| | |
if !dynamic_frameworks.include?(pod.name) | |
puts "Overriding the static_framework? method for #{pod.name}" | |
def pod.build_type; | |
Pod::Target::BuildType.static_library | |
# for static framework - Pod::Target::BuildType.static_framework | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment