Commit d4595215 authored by Marius Rackwitz's avatar Marius Rackwitz

[Target] Implement #configuration_build_dir in the concrete subclasses

parent 55aa2f01
...@@ -65,7 +65,7 @@ module Pod ...@@ -65,7 +65,7 @@ module Pod
end end
end end
build_settings = { build_settings = {
'PODS_FRAMEWORK_BUILD_PATH' => target.configuration_build_dir, 'PODS_FRAMEWORK_BUILD_PATH' => target.scoped_configuration_build_dir,
# Make headers discoverable by `import "…"` # Make headers discoverable by `import "…"`
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_paths, '-iquote'), 'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_paths, '-iquote'),
} }
......
...@@ -180,23 +180,6 @@ module Pod ...@@ -180,23 +180,6 @@ module Pod
support_files_dir + "#{label}-dummy.m" support_files_dir + "#{label}-dummy.m"
end end
# @return [String] The configuration build dir, if the target is integrated
# as framework.
#
# @note Namespace the pod target product with its target definition name.
# Pod target products are named after their specs. The namespacing
# cannot directly happen in the product name itself, because this
# must be equal to the module name and this will be used in source
# code, which should stay agnostic over the dependency manager.
# We need namespacing at all because multiple targets can exist for
# the same podspec and their products should not collide. This
# happens when multiple user targets require the same pod, because
# they could require different sets of subspecs.
#
def configuration_build_dir
"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/#{target_definition.label}"
end
#-------------------------------------------------------------------------# #-------------------------------------------------------------------------#
private private
......
...@@ -198,6 +198,13 @@ module Pod ...@@ -198,6 +198,13 @@ module Pod
"${SRCROOT}/#{relative_to_srcroot(embed_frameworks_script_path)}" "${SRCROOT}/#{relative_to_srcroot(embed_frameworks_script_path)}"
end end
# @return [String] The scoped configuration build dir, relevant if the
# target is integrated as framework.
#
def scoped_configuration_build_dir
"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/#{target_definition.label}"
end
private private
# @!group Private Helpers # @!group Private Helpers
......
...@@ -19,6 +19,17 @@ module Pod ...@@ -19,6 +19,17 @@ module Pod
# @return [Bool] whether the target needs to be scoped by target definition, # @return [Bool] whether the target needs to be scoped by target definition,
# because the spec is used with different subspec sets across them. # because the spec is used with different subspec sets across them.
# #
# @note For frameworks the target products of {PodTarget}s are named
# after their specs. The namespacing cannot directly happen in
# the product name itself, because this must be equal to the module
# name and this will be used in source code, which should stay
# agnostic over the dependency manager.
# We need namespacing because multiple targets can exist for the
# same podspec and their products should not collide. This
# duplication is needed when multiple user targets have the same
# dependency, but they require different sets of subspecs or they
# are on different platforms.
#
attr_accessor :scoped attr_accessor :scoped
alias_method :scoped?, :scoped alias_method :scoped?, :scoped
...@@ -189,6 +200,17 @@ module Pod ...@@ -189,6 +200,17 @@ module Pod
end end
end end
# @return [String] The configuration build dir, relevant if the target is
# integrated as framework.
#
def configuration_build_dir
if scoped?
"$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/#{target_definitions.first.label}"
else
'$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
end
end
private private
# @param [TargetDefinition] target_definition # @param [TargetDefinition] target_definition
......
...@@ -80,7 +80,7 @@ module Pod ...@@ -80,7 +80,7 @@ module Pod
end end
it 'returns the path for the CONFIGURATION_BUILD_DIR build setting' do it 'returns the path for the CONFIGURATION_BUILD_DIR build setting' do
@target.configuration_build_dir.should == '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods' @target.scoped_configuration_build_dir.should == '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods'
end end
end end
......
...@@ -161,7 +161,8 @@ module Pod ...@@ -161,7 +161,8 @@ module Pod
end end
it 'returns the path for the CONFIGURATION_BUILD_DIR build setting' do it 'returns the path for the CONFIGURATION_BUILD_DIR build setting' do
@pod_target.configuration_build_dir.should == '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods' @pod_target.configuration_build_dir.should == '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)'
@pod_target.scoped.configuration_build_dir.should == '$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/Pods'
end end
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