Created
June 14, 2013 16:11
-
-
Save andreashanft/5783166 to your computer and use it in GitHub Desktop.
[CocoaPods] Podfile post install hook hack - get rid of those noobish NSLogs in mediocre libs imported by cocoapods. Silences them in release builds and add class and line number info to target that sucker in debug builds
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
post_install do | installer | | |
prefix_header = installer.config.project_pods_root + 'Pods-prefix.pch' | |
text = prefix_header.read + <<-EOS | |
#if DEBUG | |
#define NSLog(fmt, ...) NSLog((@"[DEBUG] %s [Line %d] " fmt), __FUNCTION__, __LINE__, ##__VA_ARGS__) | |
#else | |
#define NSLog(fmt, ...) (void)0 | |
#endif | |
EOS | |
prefix_header.open('w') { |file| file.write(text) } | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Muhaha.