Skip to content

Commit

Permalink
Merge pull request #565 from dnkoutso/fix_user_configurations_for_pbx…
Browse files Browse the repository at this point in the history
…aggregates

Fix `add_build_configuration` for `PBXAggregateTarget`
  • Loading branch information
dnkoutso authored Apr 10, 2018
2 parents 8c51328 + 795ca2a commit aac57c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

##### Bug Fixes

* None.
* Fix `add_build_configuration` for `PBXAggregateTarget`
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#565](https://github.com/CocoaPods/Xcodeproj/pull/565)


## 1.5.7 (2018-03-22)
Expand Down
1 change: 1 addition & 0 deletions lib/xcodeproj/project/object/native_target.rb
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ def add_build_configuration(name, type)
else
build_configuration = project.new(XCBuildConfiguration)
build_configuration.name = name
product_type = self.product_type if respond_to?(:product_type)
build_configuration.build_settings = ProjectHelper.common_build_settings(type, platform_name, deployment_target, product_type)
build_configuration_list.build_configurations << build_configuration
build_configuration
Expand Down
6 changes: 6 additions & 0 deletions spec/project/object/native_target_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,12 @@ module ProjectSpecs
conf_2 = @target.add_build_configuration('App Store', :release)
conf_1.object_id.should == conf_2.object_id
end

it 'adds a new build configuration on an aggregate target' do
aggregate_target = @project.new_aggregate_target('PBXAggregateTarget')
aggregate_target.add_build_configuration('App Store', :release)
aggregate_target.build_configurations.map(&:name).grep('App Store').size.should == 1
end
end

#----------------------------------------#
Expand Down

0 comments on commit aac57c4

Please sign in to comment.