Is there a way to add build setting in a cocoapods
pod without direct changing Pods project or other auto-generated stuff, so it will still be in place after
Thanks, @Hodson, it is the solution. Slightly modified the example from documentation, we get
post_install do |installer|
#Specify what and where has to be added
targetName = 'Mixpanel'
settingKey = 'DISABLE_MIXPANEL_AB_DESIGNER'
settingValue = 1
#Find the pod which should be affected
targets = installer.pods_project.targets.select { |target| target.name == targetName }
target = targets[0]
#Do the job
target.build_configurations.each do |config|
config.build_settings[settingKey] = settingValue
end
end
Just add this code to your podfile. Obviously, in the same way you can make any changes to autogenerated pods project, and they won't ever get lost.