CocoaPods / CocoaPods/Xcodeproj

Creating a new build configuration in code?

Open
#946 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Ruby
Stars
2.4k
Forks
488
PR merge metrics
No merged PRs in 30d

Description

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 ...
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by inspecting the build_configurations API on project.targets[0] and the nested_object_for_hash error raised by the attempted code. Trace how project.save handles the objects added to the configuration collection. Done means identifying and documenting a supported way to create and save a new build configuration without the missing uuid error.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.