GrahamDennis/GDCoreDataConcurrencyDebugging — pull request #12 by QuentinArnault (2014-06-10 11:08:51+00:00)
Title: Add capacity to enable/disable logs with preprocessor macro and add capacity to raise exception

I added a preprocessor macro to disable logging (by default, logs are printed).

I added a preprocessor macro to enable raise of exception on invalid concurrency operations in addition of the existing log.

It is possible to use the macro directly in your pod files :
post_install do |installer|
target = installer.project.targets.find{|t| t.to_s == "Pods-GDCoreDataConcurrencyDebugging"}
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
s = [ '$(inherited)' ] if s == nil;
s.push('GD_CORE_DATA_CONCURRENCE_DEBUGGING_ENABLE_EXCEPTION=1') if config.to_s == "Debug";
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end

Or

post_install do |installer|
target = installer.project.targets.find{|t| t.to_s == "Pods-GDCoreDataConcurrencyDebugging"}
target.build_configurations.each do |config|
s = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
s = [ '$(inherited)' ] if s == nil;
s.push('GD_CORE_DATA_CONCURRENCE_DEBUGGING_DISABLE_LOG=1') if config.to_s == "Debug";
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = s
end
end