Unverified Commit 161ac76b authored by D. Koutsogiorgas's avatar D. Koutsogiorgas Committed by GitHub

Merge pull request #7784 from amorde/infoplist_overridden

Fix `INFOPLIST_FILE` being overridden when set in `pod_target_xcconfig`
parents 133d8367 96c79a05
......@@ -24,6 +24,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes
* Fix `INFOPLIST_FILE` being overridden when set in a Podspec's `pod_target_xcconfig`
[Eric Amorde](https://github.com/amorde)
[#7530](https://github.com/CocoaPods/CocoaPods/issues/7530)
* Raise an error if user target `SWIFT_VERSION` is missing
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7770](https://github.com/CocoaPods/CocoaPods/issues/7770)
......
......@@ -79,7 +79,7 @@ module Pod
end
if target.requires_frameworks?
unless target.static_framework?
unless skip_info_plist?(native_target)
create_info_plist_file(target.info_plist_path, native_target, target.version, target.platform)
end
create_build_phase_to_symlink_header_folders(native_target)
......@@ -114,6 +114,18 @@ module Pod
specs.any? { |spec| spec.prefix_header_file.is_a?(FalseClass) }
end
# True if info.plist generation should be skipped
#
# @param [PXNativeTarget] native_target
#
# @return [Boolean] Whether the target should build an Info.plist file
#
def skip_info_plist?(native_target)
return true if target.static_framework?
existing_setting = native_target.resolved_build_setting('INFOPLIST_FILE', true).values.compact
!existing_setting.empty?
end
# Remove the default headers folder path settings for static library pod
# targets.
#
......
......@@ -90,6 +90,16 @@ module Pod
end
end
it 'respects INFOPLIST_FILE of pod_target_xcconfig' do
@spec.pod_target_xcconfig = {
'INFOPLIST_FILE' => 'somefile.plist',
}
@installer.install!
@project.targets.first.build_configurations.each do |config|
config.resolve_build_setting('INFOPLIST_FILE').should == 'somefile.plist'
end
end
#--------------------------------------#
describe 'headers folder paths' do
......@@ -757,6 +767,34 @@ module Pod
@pod_target.dummy_source_path.read.should.include?('@interface PodsDummy_BananaLib')
end
it 'creates an info.plist file when frameworks are required' do
@pod_target.stubs(:requires_frameworks?).returns(true)
@installer.install!
group = @project['Pods/BananaLib/Support Files']
group.children.map(&:display_name).sort.should == [
'BananaLib-Info.plist',
'BananaLib-dummy.m',
'BananaLib-prefix.pch',
'BananaLib.modulemap',
'BananaLib.xcconfig',
]
end
it 'does not create an Info.plist file if INFOPLIST_FILE is set' do
@pod_target.stubs(:requires_frameworks?).returns(true)
@spec.pod_target_xcconfig = {
'INFOPLIST_FILE' => 'somefile.plist',
}
@installer.install!
group = @project['Pods/BananaLib/Support Files']
group.children.map(&:display_name).sort.should == [
'BananaLib-dummy.m',
'BananaLib-prefix.pch',
'BananaLib.modulemap',
'BananaLib.xcconfig',
]
end
#--------------------------------------------------------------------------------#
it 'creates an aggregate placeholder native target if the target should not be built' do
......
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