Created
January 11, 2016 12:21
-
-
Save a13xb/cf07c19c75ec5b4709a9 to your computer and use it in GitHub Desktop.
Quick workaround for per-target asset catalog compilation using a Podfile post_install hook
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
# ... | |
# Workaround for https://github.com/CocoaPods/CocoaPods/issues/1546 | |
post_install do |installer| | |
installer.aggregate_targets.each do |at| | |
files = at.user_targets.map{|t| | |
t.resources_build_phase.files_references.select{|f| | |
f.last_known_file_type == 'folder.assetcatalog' | |
}.map{|f| | |
Pathname.new(f.real_path).relative_path_from(f.project.path.dirname) | |
} | |
}.flatten | |
script = at.copy_resources_script_path | |
files = files.join('" "') | |
`sed -i '' 's@OTHER_XCASSETS=.*@XCASSET_FILES+=(\"#{files}\")@' '#{script}'` | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment