Unverified Commit 636d1104 authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #7451 from CocoaPods/seg-revert-7442

Revert "Merge pull request #7442 from CocoaPods/seg-vendored-framewor…
parents b6309bbd 57e1d1c9
......@@ -82,11 +82,6 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Avoid dependency resolution conflicts when a pod depends upon a local pod.
[Samuel Giddins](https://github.com/segiddins)
* When integrating a vendored framework while building pods as static
libraries, public headers will be found via `FRAMEWORK_SEARCH_PATHS`
instead of via the sandbox headers store.
[Samuel Giddins](https://github.com/segiddins)
* Fix legacy header search paths that broke due to #7116 and #7412.
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
[#7445](https://github.com/CocoaPods/CocoaPods/pull/7445)
......
......@@ -90,11 +90,9 @@ module Pod
end
end
XCConfigHelper.add_dynamic_dependency_build_settings(target, pod_target, xcconfig, include_ld_flags, test_xcconfig)
if pod_target.requires_frameworks?
pod_target.dependent_targets.each do |dependent_target|
XCConfigHelper.add_dynamic_dependency_build_settings(target, dependent_target, xcconfig, include_ld_flags, test_xcconfig)
dependent_target.file_accessors.each do |file_accessor|
XCConfigHelper.add_static_dependency_build_settings(target, dependent_target, xcconfig, file_accessor, false)
end
end
end
......
......@@ -158,6 +158,12 @@ module Pod
header_mappings(headers_sandbox, file_accessor, file_accessor.public_headers, :public).each do |namespaced_path, files|
sandbox.public_headers.add_files(namespaced_path, files)
end
unless pod_target.requires_frameworks?
vendored_frameworks_header_mappings(headers_sandbox, file_accessor).each do |namespaced_path, files|
sandbox.public_headers.add_files(namespaced_path, files)
end
end
end
end
end
......@@ -325,6 +331,36 @@ module Pod
mappings
end
# Computes the destination sub-directory in the sandbox for headers
# from inside vendored frameworks.
#
# @param [Pathname] headers_sandbox
# The sandbox where the header links should be stored for this
# Pod.
#
# @param [Sandbox::FileAccessor] file_accessor
# The consumer file accessor for which the headers need to be
# linked.
#
def vendored_frameworks_header_mappings(headers_sandbox, file_accessor)
mappings = {}
file_accessor.vendored_frameworks.each do |framework|
headers_dir = Sandbox::FileAccessor.vendored_frameworks_headers_dir(framework)
headers = Sandbox::FileAccessor.vendored_frameworks_headers(framework)
framework_name = framework.basename(framework.extname)
dir = headers_sandbox + framework_name
headers.each do |header|
# the relative path of framework headers should be kept,
# not flattened like is done for most public headers.
relative_path = header.relative_path_from(headers_dir)
sub_dir = dir + relative_path.dirname
mappings[sub_dir] ||= []
mappings[sub_dir] << header
end
end
mappings
end
#-----------------------------------------------------------------------#
end
end
......
......@@ -115,12 +115,12 @@ module Pod
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('${PODS_ROOT}/DDD')
end
it 'vendored frameworks get added to frameworks paths even if use_frameworks! isnt set' do
it 'vendored frameworks dont get added to frameworks paths if use_frameworks! isnt set' do
@pod_target.stubs(:requires_frameworks?).returns(false)
@xcconfig = @generator.generate
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('spec/fixtures/monkey')
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('${PODS_ROOT}/AAA')
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.include('${PODS_ROOT}/CCC')
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('spec/fixtures/monkey')
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('${PODS_ROOT}/AAA')
@xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should.not.include('${PODS_ROOT}/CCC')
end
it 'sets the PODS_ROOT build variable' do
......@@ -256,7 +256,7 @@ module Pod
generator = PodXCConfig.new(@coconut_pod_target, true)
xcconfig = generator.generate
xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '$(inherited) "${PODS_ROOT}/../../spec/fixtures/banana-lib" "${PODS_CONFIGURATION_BUILD_DIR}/BananaLib" "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLib"'
xcconfig.to_hash['LIBRARY_SEARCH_PATHS'].should == '$(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/BananaLib" "${PODS_CONFIGURATION_BUILD_DIR}/CoconutLib" "${PODS_ROOT}/../../spec/fixtures/banana-lib"'
end
it 'adds correct header search paths for dependent and test targets without modular headers' do
......
......@@ -90,8 +90,13 @@ module Pod
framework_subdir_header = headers_root + 'BananaLib/Bananalib/SubDir/SubBananalib.h'
public_headers.each { |public_header| public_header.should.exist }
private_header.should.not.exist
framework_header.should.not.exist
framework_subdir_header.should.not.exist
framework_header.should.exist
framework_subdir_header.should.exist
config.sandbox.public_headers.search_paths(@pod_target.platform).should == %w(
${PODS_ROOT}/Headers/Public/BananaLib
${PODS_ROOT}/Headers/Public/BananaLib/BananaLib
)
end
it 'does not link the public headers meant for the user for a vendored framework' do
......
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