Commit e0e98e51 authored by Fabio Pelosin's avatar Fabio Pelosin

[Style] Tweaks and documentation

parent b74063c4
......@@ -12,8 +12,9 @@ module Pod
# @param [Target] target @see target
#
# @param [String] configuration_name Name of the build configuration to
# generate this xcconfig for.
# @param [String] configuration_name
# The name of the build configuration to generate this xcconfig
# for.
#
def initialize(target, configuration_name)
@target = target
......
......@@ -178,7 +178,11 @@ module Pod
@aggregate_targets = analyzer.result.targets
end
# @raise Raises an informative if the hooks raises.
# Ensures that the white-listed build configurations are known to prevent
# silent typos.
#
# @raise If a unknown user configuration is found.
#
def validate_whitelisted_configurations
whitelisted_configs = pod_targets.map do |target|
target.target_definition.all_whitelisted_configurations
......
......@@ -32,14 +32,14 @@ module Pod
# @return [void]
#
def create_xcconfig_file
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.name)
target.build_configurations.each do |configuration|
path = library.xcconfig_path(configuration)
UI.message "- Generating #{configuration.name} xcconfig file at #{UI.path(path)}" do
gen = Generator::XCConfig::AggregateXCConfig.new(library, configuration.name)
gen.save_as(path)
library.xcconfigs[build_config.name] = gen.xcconfig
library.xcconfigs[configuration.name] = gen.xcconfig
xcconfig_file_ref = add_file_to_support_group(path)
build_config.base_configuration_reference = xcconfig_file_ref
configuration.base_configuration_reference = xcconfig_file_ref
end
end
end
......
......@@ -83,7 +83,7 @@ module Pod
# @return [void]
#
def create_xcconfig_file
path = library.xcconfig_path nil
path = library.xcconfig_path
public_gen = Generator::XCConfig::PublicPodXCConfig.new(library)
UI.message "- Generating public xcconfig file at #{UI.path(path)}" do
public_gen.save_as(path)
......
......@@ -110,8 +110,8 @@ module Pod
def add_xcconfig_base_configuration
native_targets.each do |native_target|
native_target.build_configurations.each do |config|
relpath = target.xcconfig_relative_path(config.name)
xcconfig = user_project.files.select { |f| f.path == relpath }.first || user_project.new_file(relpath)
path = target.xcconfig_relative_path(config.name)
xcconfig = user_project.files.select { |f| f.path == path }.first || user_project.new_file(path)
check_overridden_build_settings(target.xcconfigs[config.name], native_target)
config.base_configuration_reference = xcconfig
......
......@@ -77,12 +77,14 @@ module Pod
@sandbox.library_support_files_dir(name)
end
# @param [String] variant (optional) If you have multiple variants of xcconfigs for this target
# => (e g per build configuration), provide the variant type here.
# @param [String] variant
# The variant of the xcconfig. Used to differentiate build
# configurations.
#
# @return [Pathname] the absolute path of the xcconfig file.
#
def xcconfig_path(variant)
if variant then
def xcconfig_path(variant = nil)
if variant
support_files_root + "#{label}.#{variant}.xcconfig"
else
support_files_root + "#{label}.xcconfig"
......
......@@ -64,8 +64,11 @@ module Pod
end.flatten
end
# @param [String] configuration_name Name of the build configuration that
# the caller is unsure of if this target should be linked with.
# Checks if the target should be included in the build configuration with
# the given name.
#
# @param [String] configuration_name
# The name of the build configuration.
#
def include_in_build_config?(configuration_name)
@target_definition.pod_whitelisted_for_configuration?(pod_name, configuration_name)
......
......@@ -57,7 +57,7 @@ module Pod
end
it "returns the absolute path of the public and private xcconfig files" do
@pod_target.xcconfig_path(nil).to_s.should.include 'Pods/Pods-BananaLib.xcconfig'
@pod_target.xcconfig_path.to_s.should.include 'Pods/Pods-BananaLib.xcconfig'
@pod_target.xcconfig_private_path.to_s.should.include 'Pods/Pods-BananaLib-Private.xcconfig'
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