Commit 1697d901 authored by Fabio Pelosin's avatar Fabio Pelosin

[TargetInstaller] Cleanup

parent 78c006a9
......@@ -74,8 +74,8 @@ module Pod
# @return [void]
#
def create_dummy_source
UI.message "- Generating dummy source file" do
path = target.dummy_source_path
UI.message "- Generating dummy source file at #{UI.path(path)}" do
generator = Generator::DummySource.new(target.label)
generator.save_as(path)
file_reference = add_file_to_support_group(path)
......
......@@ -33,8 +33,8 @@ module Pod
# @return [void]
#
def create_xcconfig_file
UI.message "- Generating xcconfig file" do
path = target.xcconfig_path
UI.message "- Generating xcconfig file at #{UI.path(path)}" do
gen = Generator::XCConfig::AggregateXCConfig.new(target)
gen.save_as(path)
target.xcconfig = gen.xcconfig
......@@ -50,8 +50,8 @@ module Pod
# pods and the installed specifications of a pod.
#
def create_target_environment_header
UI.message "- Generating target environment header" do
path = target.target_environment_header_path
UI.message "- Generating target environment header at #{UI.path(path)}" do
generator = Generator::TargetEnvironmentHeader.new(target.pod_targets.map { |l| l.specs }.flatten)
generator.save_as(path)
add_file_to_support_group(path)
......@@ -68,8 +68,8 @@ module Pod
#
def create_bridge_support_file
if target_definition.podfile.generate_bridge_support?
UI.message "- Generating BridgeSupport metadata" do
path = target.bridge_support_path
UI.message "- Generating BridgeSupport metadata at #{UI.path(path)}" do
headers = target.target.headers_build_phase.files.map { |bf| sandbox.root + bf.file_ref.path }
generator = Generator::BridgeSupport.new(headers)
generator.save_as(path)
......@@ -88,8 +88,8 @@ module Pod
# @return [void]
#
def create_copy_resources_script
UI.message "- Generating copy resources script" do
path = target.copy_resources_script_path
UI.message "- Generating copy resources script at #{UI.path(path)}" do
file_accessors = target.pod_targets.map(&:file_accessors).flatten
resource_paths = file_accessors.map { |accessor| accessor.resources.flatten.map { |res| res.relative_path_from(project.path.dirname) }}.flatten
resource_bundles = file_accessors.map { |accessor| accessor.resource_bundles.keys.map {|name| "${BUILT_PRODUCTS_DIR}/#{name}.bundle" } }.flatten
......@@ -108,10 +108,10 @@ module Pod
# @return [void]
#
def create_acknowledgements
basepath = target.acknowledgements_basepath
Generator::Acknowledgements.generators.each do |generator_class|
UI.message "- Generating acknowledgements" do
basepath = target.acknowledgements_basepath
path = generator_class.path_from_basepath(basepath)
UI.message "- Generating acknowledgements at #{UI.path(path)}" do
file_accessors = target.pod_targets.map(&:file_accessors).flatten
generator = generator_class.new(file_accessors)
generator.save_as(path)
......
......@@ -38,14 +38,13 @@ module Pod
# @return [void]
#
def add_files_to_build_phases
UI.message "- Adding Build files" do
UI.message "- Adding build files" do
target.file_accessors.each do |file_accessor|
consumer = file_accessor.spec_consumer
flags = compiler_flags_for_consumer(consumer)
source_files = file_accessor.source_files
file_refs = source_files.map { |sf| project.reference_for_path(sf) }
target.target.add_file_references(file_refs, flags)
end
end
end
......@@ -64,7 +63,7 @@ module Pod
# @return [void]
#
def add_resources_bundle_targets
UI.message "- Adding resource bundles to Pods project" do
UI.message "- Adding resource bundles" do
target.file_accessors.each do |file_accessor|
file_accessor.resource_bundles.each do |bundle_name, paths|
file_references = paths.map { |sf| project.reference_for_path(sf) }
......@@ -88,9 +87,9 @@ module Pod
# @return [void]
#
def create_xcconfig_file
path = target.xcconfig_path
public_gen = Generator::XCConfig::PublicPodXCConfig.new(target)
UI.message "- Generating public xcconfig file at #{UI.path(path)}" do
UI.message "- Generating public xcconfig file" do
path = target.xcconfig_path
public_gen.save_as(path)
#
# TODO
......@@ -100,9 +99,9 @@ module Pod
# group.new_file(relative_path)
end
UI.message "- Generating private xcconfig file" do
path = target.xcconfig_private_path
private_gen = Generator::XCConfig::PrivatePodXCConfig.new(target, public_gen.xcconfig)
UI.message "- Generating private xcconfig file at #{UI.path(path)}" do
private_gen.save_as(path)
xcconfig_file_ref = add_file_to_support_group(path)
......@@ -119,8 +118,8 @@ module Pod
# @return [void]
#
def create_prefix_header
UI.message "- Generating prefix header" do
path = target.prefix_header_path
UI.message "- Generating prefix header at #{UI.path(path)}" do
generator = Generator::PrefixHeader.new(target.file_accessors, target.platform)
generator.imports << target.target_environment_header_path.basename
generator.save_as(path)
......
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