Commit c3d23564 authored by Joachim Bengtsson's avatar Joachim Bengtsson Committed by Eloy Durán

WIP: Support for defining pods per build config

This is not even nearly functional, I'm just prodding pieces of code to
see how it works.
parent b6ca8ff2
......@@ -11,9 +11,11 @@ module Pod
attr_reader :target
# @param [Target] target @see target
# @param [String] build_config Name of the build config to generate this xcconfig for
#
def initialize(target)
def initialize(target, build_config)
@target = target
@build_config = build_config
end
# @return [Xcodeproj::Config] The generated xcconfig.
......@@ -54,6 +56,8 @@ module Pod
})
target.pod_targets.each do |pod_target|
next unless pod_target.include_in_build_config? @build_config
pod_target.file_accessors.each do |file_accessor|
XCConfigHelper.add_spec_build_settings_to_xcconfig(file_accessor.spec_consumer, @xcconfig)
file_accessor.vendored_frameworks.each do |vendored_framework|
......
......@@ -32,15 +32,14 @@ module Pod
# @return [void]
#
def create_xcconfig_file
path = library.xcconfig_path
UI.message "- Generating xcconfig file at #{UI.path(path)}" do
gen = Generator::XCConfig::AggregateXCConfig.new(library)
gen.save_as(path)
library.xcconfig = gen.xcconfig
xcconfig_file_ref = add_file_to_support_group(path)
target.build_configurations.each do |c|
c.base_configuration_reference = xcconfig_file_ref
target.build_configurations.each do |build_config|
path = library.xcconfig_path build_config
UI.message "- Generating #{build_config.name} xcconfig file at #{UI.path(path)}" do
gen = Generator::XCConfig::AggregateXCConfig.new(library, build_config)
gen.save_as(path)
library.xcconfigs[build_config.name] = gen.xcconfig
xcconfig_file_ref = add_file_to_support_group(path)
build_config.base_configuration_reference = xcconfig_file_ref
end
end
end
......
......@@ -79,8 +79,8 @@ module Pod
# @return [Pathname] the absolute path of the xcconfig file.
#
def xcconfig_path
support_files_root + "#{label}.xcconfig"
def xcconfig_path variant
support_files_root + "#{label}-#{variant}.xcconfig"
end
# @return [Pathname] the absolute path of the private xcconfig file.
......
......@@ -13,6 +13,7 @@ module Pod
@sandbox = sandbox
@pod_targets = []
@file_accessors = []
@xcconfigs = {}
end
# @return [String] the label for the target.
......@@ -44,13 +45,14 @@ module Pod
#
attr_accessor :user_target_uuids
# @return [Xcodeproj::Config] The configuration file of the target.
# @return [Hash<String, Xcodeproj::Config>] Map from configuration name to configuration file for the target
#
# @note The configuration is generated by the {TargetInstaller} and
# @note The configurations are generated by the {TargetInstaller} and
# used by {UserProjectIntegrator} to check for any overridden
# values.
#
attr_accessor :xcconfig
attr_reader :xcconfigs
# @return [Array<PodTarget>] The dependencies for this target.
#
......@@ -90,11 +92,12 @@ module Pod
"${SRCROOT}/#{support_files_root.relative_path_from(client_root)}"
end
# @param [String] config_name The build configuration name to get the xcconfig for
# @return [String] The path of the xcconfig file relative to the root of
# the user project.
#
def xcconfig_relative_path
relative_to_srcroot(xcconfig_path).to_s
def xcconfig_relative_path config_name
relative_to_srcroot(xcconfig_path, config_name).to_s
end
# @return [String] The path of the copy resources script relative to the
......
......@@ -64,5 +64,11 @@ module Pod
end.flatten
end
# @param [String] build_config Name of the build configuration that caller is unsure if this target should
# be linked with.
def include_in_build_config? build_config
true
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