diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d3721a8d..85e45f852 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ * DSL for `scheme` support. [Dimitris Koutsogiorgas](https://github.com/dnkoutso) [#7577](https://github.com/CocoaPods/CocoaPods/issues/7577) + [#479](https://github.com/CocoaPods/Core/pull/479) * Replace `test_only` attribute option with `spec_types`. [Dimitris Koutsogiorgas](https://github.com/dnkoutso) diff --git a/lib/cocoapods-core/specification/linter.rb b/lib/cocoapods-core/specification/linter.rb index 05061d08d..c2cf2e5f2 100644 --- a/lib/cocoapods-core/specification/linter.rb +++ b/lib/cocoapods-core/specification/linter.rb @@ -418,6 +418,9 @@ def _validate_script_phases(s) # Performs validation related to the `scheme` attribute. # def _validate_scheme(s) + if consumer.spec.subspec? && consumer.spec.library_specification? + results.add_error('scheme', 'Scheme configuration is not currently supported for subspecs.') + end if s.key?(:launch_arguments) && !s[:launch_arguments].is_a?(Array) results.add_error('scheme', 'Expected an array for key `launch_arguments`.') end diff --git a/spec/specification/linter_spec.rb b/spec/specification/linter_spec.rb index b1837546b..8709cdb29 100644 --- a/spec/specification/linter_spec.rb +++ b/spec/specification/linter_spec.rb @@ -610,6 +610,13 @@ def result_should_include(*values) #------------------# + it 'fails if a subspec specifies a scheme' do + @subspec.scheme = { :launch_arguments => ['Arg1'] } + result_should_include('scheme', 'Scheme configuration is not currently supported for subspecs.') + end + + #------------------# + it 'fails a specification with a subspec with a module map' do @subspec.module_map = 'subspec.modulemap' result_should_include('module_map', 'can\'t set', 'for subspecs')