Commit 6baa574a authored by Marius Rackwitz's avatar Marius Rackwitz

Link the pod targets among each other in Xcode

parent 2c034e12
......@@ -58,12 +58,10 @@ module Pod
}
if target.requires_frameworks?
dependencies = target.module_dependencies.reject { |dep| dep == target.product_module_name }
build_settings = {
'PODS_FRAMEWORK_BUILD_PATH' => target.configuration_build_dir,
'CONFIGURATION_BUILD_DIR' => '$PODS_FRAMEWORK_BUILD_PATH',
'FRAMEWORK_SEARCH_PATHS' => '"$PODS_FRAMEWORK_BUILD_PATH"',
'OTHER_LDFLAGS' => '$(inherited) ' + XCConfigHelper.quote(dependencies, '-framework')
}
config.merge!(build_settings)
end
......
......@@ -450,6 +450,7 @@ module Pod
# @return [void]
#
def set_target_dependencies
frameworks_group = pods_project.frameworks_group
aggregate_targets.each do |aggregate_target|
aggregate_target.pod_targets.each do |pod_target|
unless pod_target.should_build?
......@@ -470,6 +471,12 @@ module Pod
puts "[BUG] DEP: #{dep}"
end
pod_target.native_target.add_dependency(pod_dependency_target.native_target)
if pod_target.requires_frameworks?
product_ref = frameworks_group.files.find { |f| f.path == pod_dep_target.product_name } ||
frameworks_group.new_product_ref_for_target(pod_dependency_target.product_basename, pod_dependency_target.product_type)
pod_target.native_target.frameworks_build_phase.add_file_reference(product_ref)
end
end
end
end
......
......@@ -91,13 +91,6 @@ module Pod
end.flatten
end
# @return [Array<String>] The module names of the Pods on which this target
# depends.
#
def module_dependencies
dependencies.map { |dep_name| c99ext_identifier(dep_name) }
end
# Checks if the target should be included in the build configuration with
# the given name.
#
......
......@@ -75,6 +75,7 @@ module Pod
@installer.stubs(:run_pre_install_hooks)
@installer.stubs(:install_file_references)
@installer.stubs(:install_libraries)
@installer.stubs(:set_target_dependencies)
@installer.stubs(:write_lockfiles)
@installer.stubs(:aggregate_targets).returns([])
@installer.unstub(:generate_pods_project)
......@@ -417,9 +418,12 @@ module Pod
pod_target.stubs(:should_build? => false)
target = AggregateTarget.new(target_definition, config.sandbox)
mock_target = mock
mock_target = mock('PodNativeTarget')
mock_target.expects(:add_dependency).with('dummy')
mock_project = mock('PodsProject', :frameworks_group => mock('FrameworksGroup'))
@installer.stubs(:pods_project).returns(mock_project)
target.stubs(:native_target).returns(mock_target)
target.stubs(:pod_targets).returns([pod_target])
@installer.stubs(:aggregate_targets).returns([target])
......
......@@ -38,11 +38,6 @@ module Pod
@pod_target.dependencies.should == ['monkey']
end
it 'returns the name of the modules of the Pods on which this target depends' do
@pod_target.stubs(:dependencies).returns(['human', 'M!lk', '3xP-Blender'])
@pod_target.module_dependencies.should == %w(human M_lk _3xP_Blender)
end
it 'returns whether it is whitelisted in a build configuration' do
@target_definition.store_pod('BananaLib')
@target_definition.whitelist_pod_for_configuration('BananaLib', 'debug')
......
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