CocoaPods / Xcodeproj

Create and modify Xcode projects from Ruby.
http://rubygems.org/gems/xcodeproj
MIT License
2.35k stars 455 forks source link

Creating a new build configuration in code? #946

Open M1ke opened 3 months ago

M1ke commented 3 months ago

I can see how the code can iterate over existing build configurations but not how to make a new one. For example I tried the following:

build_configurations = [
  # Pick some specific items per config
  {'name' => "MyConfig"},
  # more configs here
]

target = project.targets[0]
build_configurations.each do |config|
  # Define defaults for all configs
  config['isa'] = "XCBuildConfiguration"

  project.targets.first.build_configurations.push(config)
end

project.save

But I receive the error

`nested_object_for_hash': undefined method `uuid' for ...