thekevinbrown/react-native-schemes-manager

Support also fixing the cocoapods generated project.pbxproj

n1ru4l opened this issue · 1 comments

Steps to reproduce the behavior

Install you cocoapod dependencies, which generates the file ios/Pods/Pods.xcodeproj/project.pbxproj (because you add React and other dependencies via cocoapods).

Run react-native-schemes-manager all.

Expected behavior

The ios/Pods/Pods.xcodeproj/project.pbxproj project file is also fixed and should have the right preprocessor macro variables.

Actual behavior

The ios/Pods/Pods.xcodeproj/project.pbxproj project file is missing the DEBUG variable.

screen shot 2018-03-04 at 22 37 51

I fixes this by adding the following to my Podfile:

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    if config.name.start_with?("Debug")
      config.build_settings["GCC_PREPROCESSOR_DEFINITIONS"].push("DEBUG=1")
      config.build_settings["GCC_OPTIMIZATION_LEVEL"] = 0
      config.build_settings["DEBUG_INFORMATION_FORMAT"] = "dwarf"
      config.build_settings["SWIFT_ACTIVE_COMPILATION_CONDITIONS"] = "DEBUG"
      config.build_settings["MTL_ENABLE_DEBUG_INFO"] = "YES"
    end
  end
end

I am closing this because I think this is out of scope for this project.