Skip to content

Commit

Permalink
Prevent subspecs from specifying scheme configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkoutso committed Dec 12, 2018
1 parent a0ba4fe commit 9b76730
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 9b76730

Please sign in to comment.