Skip to content

Commit

Permalink
Do not symlink headers that belong to test specs
Browse files Browse the repository at this point in the history
  • Loading branch information
dnkoutso committed May 21, 2018
1 parent 815f56b commit ca6e928
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -28,6 +28,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[chuganzy](https://github.com/chuganzy)
[#7724](https://github.com/CocoaPods/CocoaPods/pull/7724)

* Do not symlink headers that belong to test specs
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7762](https://github.com/CocoaPods/CocoaPods/pull/7762)

* Do not build pod target if it only contains script phases
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7746](https://github.com/CocoaPods/CocoaPods/issues/7746)
Expand Down
Expand Up @@ -144,7 +144,8 @@ def link_headers
added_build_headers = false
added_public_headers = false

pod_target.file_accessors.each do |file_accessor|
file_accessors = pod_target.file_accessors.reject { |fa| fa.spec.test_specification? }
file_accessors.each do |file_accessor|
# Private headers will always end up in Pods/Headers/Private/PodA/*.h
# This will allow for `""` imports to work.
header_mappings(headers_sandbox, file_accessor, file_accessor.headers).each do |namespaced_path, files|
Expand Down
Expand Up @@ -114,13 +114,29 @@ class PodsProjectGenerator
)
end

it "doesn't link public headers from vendored framework, when frameworks required" do
Target.any_instance.stubs(:requires_frameworks?).returns(true)
it 'does not link public headers from vendored framework, when frameworks required' do
@pod_target.stubs(:requires_frameworks?).returns(true)
@installer.install!
headers_root = config.sandbox.public_headers.root
framework_header = headers_root + 'BananaLib/Bananalib/Bananalib.h'
framework_header.should.not.exist
end

it 'does not symlink headers that belong to test specs' do
coconut_spec = fixture_spec('coconut-lib/CoconutLib.podspec')
coconut_test_spec = coconut_spec.test_specs.first
coconut_pod_target = fixture_pod_target_with_specs([coconut_spec, coconut_test_spec], false)
public_headers_root = config.sandbox.public_headers.root
private_headers_root = coconut_pod_target.build_headers.root
project = Project.new(config.sandbox.project_path)
project.add_pod_group('CoconutLib', fixture('coconut-lib'))
installer = FileReferencesInstaller.new(config.sandbox, [coconut_pod_target], project)
installer.install!
(public_headers_root + 'CoconutLib/Coconut.h').should.exist
(public_headers_root + 'CoconutLib/CoconutTestHeader.h').should.not.exist
(private_headers_root + 'CoconutLib/Coconut.h').should.exist
(private_headers_root + 'CoconutLib/CoconutTestHeader.h').should.not.exist
end
end

#-------------------------------------------------------------------------#
Expand Down

0 comments on commit ca6e928

Please sign in to comment.