Created
December 6, 2019 16:39
-
-
Save Dimon70007/ecf9eaf8d0d0ae380512d94cf800c492 to your computer and use it in GitHub Desktop.
cocoapods Debug hook for project with many schemes and configurations
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
# targets with dependencies | |
# This is an alternative for manually specifying every configuration as :debug [link](http://guides.cocoapods.org/syntax/podfile.html#project). | |
# Because of cocoapods by default uses :release type for all configurations but Debug | |
# we need to change every configuration, named <configuration_name>.Debug | |
# at the bottom of file | |
post_install do |installer_representation| | |
installer_representation.pods_project.targets.each do |target| | |
target.build_configurations.each do |config| | |
if config.name.include?('.Debug') | |
config.build_settings['ONLY_ACTIVE_ARCH'] = 'YES' | |
config.build_settings['VALIDATE_PRODUCT'] = 'NO' | |
config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'DWARF' | |
config.build_settings['ENABLE_TESTABILITY'] = 'YES' | |
config.build_settings['GCC_OPTIMIZATION_LEVEL'] = '0' | |
config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Onone' | |
config.build_settings['ENABLE_NS_ASSERTIONS'] = 'YES' | |
config.build_settings['SWIFT_COMPILATION_MODE'] = 'singlefile' | |
config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS'] = "$(inherited) DEBUG" | |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = "$(inherited) DEBUG=1" | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanx for posting. As soon as I run pod install again I get warnings in
Update Project Settings
for the flags set!