Created
May 18, 2014 19:06
-
-
Save rickyah/d946e416ad979aef87d3 to your computer and use it in GitHub Desktop.
Remove static lib dependencies when the user project for a CocoaPods is an static lib project itself
This file contains hidden or 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
# we don't want to link static libs or it will fail to build | |
# see https://github.com/CocoaPods/CocoaPods/issues/117 | |
targets = [:target1, :target2] | |
lib_dependencies = ['z'] | |
post_install do |installer| | |
installer.libraries.select { |i| targets.include? i.target_definition.name.to_sym }.each do |l| | |
config_file_path = l.library.xcconfig_path | |
config_file_contents = File.read(config_file_path) | |
lib_dependencies.each { |dep| config_file_contents.gsub!(/ -l#{dep}/, '') } | |
File.open(config_file_path, 'w') { |file| file.write config_file_contents } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment