Commit dcfc2e3c authored by Eloy Durán's avatar Eloy Durán

[Project] Make legacy Xcode build root support customizable.

parent 2748a78b
...@@ -66,6 +66,8 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -66,6 +66,8 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[#2912](https://github.com/CocoaPods/CocoaPods/issues/2912) [#2912](https://github.com/CocoaPods/CocoaPods/issues/2912)
* Adding Xcode Legacy build location support for default Pods.xcodeproj. * Adding Xcode Legacy build location support for default Pods.xcodeproj.
It defaults to `${SRCROOT}/../build` but can be changed in a `post_install`
hook by using the `Project#symroot=` writer.
[Sam Marshall](https://github.com/samdmarshall) [Sam Marshall](https://github.com/samdmarshall)
##### Bug Fixes ##### Bug Fixes
......
...@@ -17,9 +17,7 @@ module Pod ...@@ -17,9 +17,7 @@ module Pod
@refs_by_absolute_path = {} @refs_by_absolute_path = {}
@pods = new_group('Pods') @pods = new_group('Pods')
@development_pods = new_group('Development Pods') @development_pods = new_group('Development Pods')
configs = root_object.build_configuration_list.build_configurations self.symroot = LEGACY_BUILD_ROOT
settings_for_all_configs = configs.map(&:build_settings)
settings_for_all_configs.each { |settings| settings['SYMROOT'] = '${SRCROOT}/../build' }
end end
# @return [PBXGroup] The group for the support files of the aggregate # @return [PBXGroup] The group for the support files of the aggregate
...@@ -37,6 +35,25 @@ module Pod ...@@ -37,6 +35,25 @@ module Pod
public public
# @!group Legacy Xcode build root
#-------------------------------------------------------------------------#
LEGACY_BUILD_ROOT = '${SRCROOT}/../build'
# @param [String] symroot
# The build root that is used when Xcode is configured to not use the
# workspace’s build root. Defaults to `${SRCROOT}/../build`.
#
# @return [void]
#
def symroot=(symroot)
root_object.build_configuration_list.build_configurations.each do |config|
config.build_settings['SYMROOT'] = symroot
end
end
public
# @!group Pod Groups # @!group Pod Groups
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
...@@ -20,6 +20,21 @@ module Pod ...@@ -20,6 +20,21 @@ module Pod
it 'creates the development Pods group on initialization' do it 'creates the development Pods group on initialization' do
@project.development_pods.name.should == 'Development Pods' @project.development_pods.name.should == 'Development Pods'
end end
def settings_for_root_configs(key)
@project.root_object.build_configuration_list.build_configurations.map do |config|
config.build_settings[key]
end
end
it 'assigns a SYMROOT to each root build configuration' do
@project.symroot = 'some/build/path'
settings_for_root_configs('SYMROOT').uniq.should == ['some/build/path']
end
it 'sets a default SYMROOT for legacy Xcode build setups' do
settings_for_root_configs('SYMROOT').uniq.should == [Project::LEGACY_BUILD_ROOT]
end
end end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment