Commit 16543022 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Support vendored dynamic frameworks

parent fc373229
......@@ -47,8 +47,10 @@ module Pod
{
if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then
local source="${BUILT_PRODUCTS_DIR}/$1"
else
elsif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then
local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")"
elsif [ -r "$1" ]; then
local source="$1"
fi
local destination="${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}"
......
......@@ -18,8 +18,8 @@ module Pod
create_info_plist_file
create_module_map
create_umbrella_header
create_embed_frameworks_script
end
create_embed_frameworks_script
create_bridge_support_file
create_copy_resources_script
create_acknowledgements
......@@ -145,10 +145,12 @@ module Pod
frameworks_by_config = {}
target.user_build_configurations.keys.each do |config|
relevant_pod_targets = target.pod_targets.select do |pod_target|
pod_target.include_in_build_config?(target_definition, config) && pod_target.should_build?
pod_target.include_in_build_config?(target_definition, config)
end
frameworks_by_config[config] = relevant_pod_targets.map do |pod_target|
"#{target_definition.label}/#{pod_target.product_name}"
frameworks_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
frameworks = pod_target.file_accessors.flat_map(&:vendored_dynamic_frameworks).map { |fw| "${PODS_ROOT}/#{fw.relative_path_from(sandbox.root)}" }
frameworks << "#{target_definition.label}/#{pod_target.product_name}" if pod_target.should_build? && pod_target.requires_frameworks?
frameworks
end
end
generator = Generator::EmbedFrameworksScript.new(frameworks_by_config)
......
......@@ -46,7 +46,7 @@ module Pod
remove_embed_frameworks_script_phases,
unless native_targets_to_integrate.empty?
add_pods_library
add_embed_frameworks_script_phase if target.requires_frameworks?
add_embed_frameworks_script_phase
add_copy_resources_script_phase
add_check_manifest_lock_script_phase
true
......
......@@ -47,6 +47,7 @@ module Pod
'Pods-acknowledgements.markdown',
'Pods-acknowledgements.plist',
'Pods-dummy.m',
'Pods-frameworks.sh',
'Pods-resources.sh',
'Pods.appstore.xcconfig',
'Pods.debug.xcconfig',
......
......@@ -108,11 +108,11 @@ module Pod
phase.nil?.should == false
end
it 'does not add an embed frameworks build phase by default' do
it 'adds an embed frameworks build phase by default' do
@target_integrator.integrate!
target = @target_integrator.send(:native_targets).first
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
phase.nil?.should == true
phase.nil?.should == false
end
it 'does not add an embed frameworks build phase if the target to integrate is a framework' do
......@@ -162,14 +162,14 @@ module Pod
phase.nil?.should == true
end
it 'removes existing embed frameworks build phases if frameworks are not used anymore' do
it 'does not remove existing embed frameworks build phases if frameworks are not used anymore' do
@pod_bundle.stubs(:requires_frameworks? => true)
@target_integrator.integrate!
@pod_bundle.stubs(:requires_frameworks? => false)
@target_integrator.integrate!
target = @target_integrator.send(:native_targets).first
phase = target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' }
phase.nil?.should == true
phase.nil?.should == false
end
end
......
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