Properly namespace Info.plist names during target installation

parent a55c5bee
...@@ -13,6 +13,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -13,6 +13,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Properly namespace Info.plist names during target installation
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7611](https://github.com/CocoaPods/CocoaPods/pull/7611)
* Fix modular header access to header_dir's. * Fix modular header access to header_dir's.
[Paul Beusterien](https://github.com/paulb777) [Paul Beusterien](https://github.com/paulb777)
[#7597](https://github.com/CocoaPods/CocoaPods/issues/7597) [#7597](https://github.com/CocoaPods/CocoaPods/issues/7597)
......
...@@ -228,7 +228,8 @@ module Pod ...@@ -228,7 +228,8 @@ module Pod
# #
def add_test_app_host_targets def add_test_app_host_targets
target.test_specs.each do |test_spec| target.test_specs.each do |test_spec|
next unless test_spec.consumer(target.platform).requires_app_host? spec_consumer = test_spec.consumer(target.platform)
next unless spec_consumer.requires_app_host?
name = target.app_host_label(test_spec.test_type) name = target.app_host_label(test_spec.test_type)
platform_name = target.platform.name platform_name = target.platform.name
app_host_target = project.targets.find { |t| t.name == name } app_host_target = project.targets.find { |t| t.name == name }
...@@ -241,7 +242,7 @@ module Pod ...@@ -241,7 +242,7 @@ module Pod
configuration.build_settings['CODE_SIGN_IDENTITY'] = '' if target.platform == :osx configuration.build_settings['CODE_SIGN_IDENTITY'] = '' if target.platform == :osx
end end
Pod::Generator::AppTargetHelper.add_app_host_main_file(project, app_host_target, platform_name, name) Pod::Generator::AppTargetHelper.add_app_host_main_file(project, app_host_target, platform_name, name)
app_host_info_plist_path = project.path.dirname.+("#{name}/Info.plist") app_host_info_plist_path = target.app_host_info_plist_path_for_test_type(spec_consumer.test_type)
create_info_plist_file(app_host_info_plist_path, app_host_target, '1.0.0', target.platform, :appl) create_info_plist_file(app_host_info_plist_path, app_host_target, '1.0.0', target.platform, :appl)
end end
# Wire all test native targets with the app host. # Wire all test native targets with the app host.
......
...@@ -207,7 +207,7 @@ module Pod ...@@ -207,7 +207,7 @@ module Pod
# @return [Pathname] the absolute path of the Info.plist file. # @return [Pathname] the absolute path of the Info.plist file.
# #
def info_plist_path def info_plist_path
support_files_dir + 'Info.plist' support_files_dir + "#{label}-Info.plist"
end end
# @return [Pathname] the path of the dummy source generated by CocoaPods # @return [Pathname] the path of the dummy source generated by CocoaPods
......
...@@ -407,6 +407,15 @@ module Pod ...@@ -407,6 +407,15 @@ module Pod
"AppHost-#{Platform.string_name(platform.symbolic_name)}-#{test_type.capitalize}-Tests" "AppHost-#{Platform.string_name(platform.symbolic_name)}-#{test_type.capitalize}-Tests"
end end
# @param [Symbol] test_type
# The test type this Info.plist path is for.
#
# @return [Pathname] The absolute path of the Info.plist to use for an app host.
#
def app_host_info_plist_path_for_test_type(test_type)
support_files_dir + "#{app_host_label(test_type)}-Info.plist"
end
# @param [Symbol] test_type # @param [Symbol] test_type
# The test type this embed frameworks script path is for. # The test type this embed frameworks script path is for.
# #
......
Subproject commit e0ba219ce2b04a7799c55543e008498b414b34be Subproject commit 85c698852186908ce780ae9c0d5eaced0566990a
...@@ -602,7 +602,7 @@ module Pod ...@@ -602,7 +602,7 @@ module Pod
it 'sets the correct Info.plist file path' do it 'sets the correct Info.plist file path' do
@bundle_target.build_configurations.each do |bc| @bundle_target.build_configurations.each do |bc|
bc.build_settings['INFOPLIST_FILE'].should == 'Target Support Files/BananaLib-Pods-SampleProject/ResourceBundle-banana_bundle-Info.plist' bc.build_settings['INFOPLIST_FILE'].should == 'Target Support Files/BananaLib-Pods-SampleProject/ResourceBundle-banana_bundle-BananaLib-Pods-SampleProject-Info.plist'
end end
end end
......
...@@ -193,10 +193,10 @@ module Pod ...@@ -193,10 +193,10 @@ module Pod
it 'returns the absolute path of the info plist file' do it 'returns the absolute path of the info plist file' do
@pod_target.info_plist_path.to_s.should.include?( @pod_target.info_plist_path.to_s.should.include?(
'Pods/Target Support Files/BananaLib/Info.plist', 'Pods/Target Support Files/BananaLib/BananaLib-Info.plist',
) )
@pod_target.scoped.first.info_plist_path.to_s.should.include?( @pod_target.scoped.first.info_plist_path.to_s.should.include?(
'Pods/Target Support Files/BananaLib-Pods/Info.plist', 'Pods/Target Support Files/BananaLib-Pods/BananaLib-Pods-Info.plist',
) )
end end
...@@ -564,6 +564,10 @@ module Pod ...@@ -564,6 +564,10 @@ module Pod
exception.message.should.include 'Unknown product type `weird_product_type`' exception.message.should.include 'Unknown product type `weird_product_type`'
end end
it 'returns correct app host info plist path for test type' do
@test_pod_target.app_host_info_plist_path_for_test_type(:unit).to_s.should.include 'Pods/Target Support Files/CoconutLib/AppHost-iOS-Unit-Tests-Info.plist'
end
it 'returns correct copy resources script path for test unit test type' do it 'returns correct copy resources script path for test unit test type' do
@test_pod_target.copy_resources_script_path_for_test_type(:unit).to_s.should.include 'Pods/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-resources.sh' @test_pod_target.copy_resources_script_path_for_test_type(:unit).to_s.should.include 'Pods/Target Support Files/CoconutLib/CoconutLib-Unit-Tests-resources.sh'
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