Commit e0e98e51 authored by Fabio Pelosin's avatar Fabio Pelosin

[Style] Tweaks and documentation

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