Created
January 17, 2014 07:49
-
-
Save OdNairy/8469800 to your computer and use it in GitHub Desktop.
Disable Magical Record in Podfile for 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
class Pod::Podfile | |
def self.MR_disable_logging(installer) | |
target = installer.project.targets.find{|t| t.to_s == "Pods-MagicalRecord"} | |
target.build_configurations.each do |config| | |
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] | |
s = [ '$(inherited)' ] if s == nil; | |
s.push('MR_ENABLE_ACTIVE_RECORD_LOGGING=0') if config.to_s == "Debug"; | |
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s | |
end | |
end | |
end | |
post_install do |installer| | |
Pod::Podfile::MR_disable_logging(installer) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment