react-native-navigation的迁移库

detoxDebugFix.rb 1.2KB

123456789101112131415161718192021222324252627282930313233
  1. #!/usr/bin/env ruby
  2. require 'pathname'
  3. $LOAD_PATH.unshift(__dir__ + "/../node_modules/detox/scripts/Xcodeproj/lib")
  4. $LOAD_PATH.unshift(__dir__ + "/../node_modules/detox/scripts/Nanaimo/lib")
  5. require 'xcodeproj'
  6. isAlwaysDebug = ARGV.count > 0 && ARGV[0].to_s.eql?('debug')
  7. project = Xcodeproj::Project.open(__dir__ + "/../node_modules/react-native/React/React.xcodeproj")
  8. debug_preprocessor_macros = project.build_configuration_list['Debug'].build_settings['GCC_PREPROCESSOR_DEFINITIONS']
  9. release_preprocessor_macros = project.build_configuration_list['Release'].build_settings['GCC_PREPROCESSOR_DEFINITIONS']
  10. unless debug_preprocessor_macros.kind_of?(Array)
  11. debug_preprocessor_macros = [debug_preprocessor_macros]
  12. end
  13. unless release_preprocessor_macros.kind_of?(Array)
  14. release_preprocessor_macros = [release_preprocessor_macros]
  15. end
  16. if isAlwaysDebug then
  17. release_preprocessor_macros = release_preprocessor_macros | debug_preprocessor_macros
  18. else
  19. release_preprocessor_macros = release_preprocessor_macros - debug_preprocessor_macros
  20. end
  21. project.build_configuration_list['Release'].build_settings['GCC_PREPROCESSOR_DEFINITIONS'] = release_preprocessor_macros
  22. raise "Error: Unable to save Xcode project" unless project.save()