Commit 4c7ce87f authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4319 from CocoaPods/seg-validated-modulemap

[Validator] Compile with -Wincomplete-umbrella
parents fc1577c7 55c6d4a5
...@@ -25,6 +25,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -25,6 +25,11 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
of their headers inside that directory. of their headers inside that directory.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
* Pods will be validated with the `-Wincomplete-umbrella` compiler flag to
ensure module maps are valid.
[Samuel Giddins](https://github.com/segiddins)
[#3428](https://github.com/CocoaPods/CocoaPods/issues/3428)
##### Bug Fixes ##### Bug Fixes
* Improve repo lint error message when no repo found with given name. * Improve repo lint error message when no repo found with given name.
......
...@@ -372,12 +372,18 @@ module Pod ...@@ -372,12 +372,18 @@ module Pod
deployment_target = spec.subspec_by_name(subspec_name).deployment_target(consumer.platform_name) deployment_target = spec.subspec_by_name(subspec_name).deployment_target(consumer.platform_name)
@installer.aggregate_targets.each do |target| @installer.aggregate_targets.each do |target|
target.pod_targets.each do |pod_target|
pod_target.native_target.build_configuration_list.build_configurations.each do |build_configuration|
(build_configuration.build_settings['OTHER_CFLAGS'] ||= '$(inherited)') << ' -Wincomplete-umbrella'
end
end
if target.pod_targets.any?(&:uses_swift?) && consumer.platform_name == :ios && if target.pod_targets.any?(&:uses_swift?) && consumer.platform_name == :ios &&
(deployment_target.nil? || Version.new(deployment_target).major < 8) (deployment_target.nil? || Version.new(deployment_target).major < 8)
uses_xctest = target.spec_consumers.any? { |c| (c.frameworks + c.weak_frameworks).include? 'XCTest' } uses_xctest = target.spec_consumers.any? { |c| (c.frameworks + c.weak_frameworks).include? 'XCTest' }
error('swift', 'Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.') unless uses_xctest error('swift', 'Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.') unless uses_xctest
end end
end end
@installer.pods_project.save
end end
def validate_vendored_dynamic_frameworks def validate_vendored_dynamic_frameworks
......
...@@ -412,6 +412,20 @@ module Pod ...@@ -412,6 +412,20 @@ module Pod
validator.validate validator.validate
end end
it 'sets the -Wincomplete-umbrella compiler flag for pod targets' do
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.no_clean = true
validator.stubs(:check_file_patterns)
validator.stubs(:validate_url)
validator.validate
pods_project = Xcodeproj::Project.open(validator.validation_dir + 'Pods/Pods.xcodeproj')
pods_project.native_targets.find { |nt| nt.name == 'JSONKit' }.resolved_build_setting('OTHER_CFLAGS').each do |_, value|
value.should == %w($(inherited) -Wincomplete-umbrella)
end
end
it 'does filter InputFile errors completely' do it 'does filter InputFile errors completely' do
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url)) validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.stubs(:check_file_patterns) validator.stubs(:check_file_patterns)
......
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