Skip to content

Commit

Permalink
[Podfile] Allow inhibit_all_warnings! in parent and child scopes
Browse files Browse the repository at this point in the history
Closes #472
  • Loading branch information
amorde committed Dec 8, 2018
1 parent b7146a5 commit 886b33b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/cocoapods-core/podfile/target_definition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ def inhibit_warnings_hash
if inhibit_hash['all']
# Clean pods that are set to not inhibit inside parent if inhibit_all_warnings! was set.
parent_hash['not_for_pods'] = nil
inhibit_hash.delete('all') if parent_hash['all']
end
parent_hash.merge(inhibit_hash) do |_, l, r|
Array(l).concat(r).uniq
Expand Down
19 changes: 19 additions & 0 deletions spec/podfile/dsl_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,25 @@ module Pod
target = podfile.target_definitions['InheritedLevelTwo']
target.inhibits_warnings_for_pod?('PonyDebugger').should.be.true
end

it 'allows inhibiting all warnings in parent and child scopes' do
podfile = Podfile.new do
inhibit_all_warnings!
target 'App' do
pod 'PonyDebugger'
inhibit_all_warnings!
target 'Inherited' do
inhibit_all_warnings!
end
end
end

target = podfile.target_definitions['App']
target.inhibits_warnings_for_pod?('PonyDebugger').should.be.true

target = podfile.target_definitions['Inherited']
target.inhibits_warnings_for_pod?('PonyDebugger').should.be.true
end
end

describe 'modular headers' do
Expand Down

0 comments on commit 886b33b

Please sign in to comment.