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

[TargetInstaller] Cleanup

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