Commit cfb74e5f authored by Fabio Pelosin's avatar Fabio Pelosin

[UI] Tune verbose output

parent 270907f1
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AFNetworking Example-resources.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AFNetworking Example/Pods-AFNetworking Example-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
......
...@@ -295,7 +295,7 @@ ...@@ -295,7 +295,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AFNetworking iOS Example-resources.sh\"\n"; shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-AFNetworking iOS Example/Pods-AFNetworking iOS Example-resources.sh\"\n";
showEnvVarsInLog = 0; showEnvVarsInLog = 0;
}; };
E4419DF1E8B742E49777FFE0 /* Check Pods Manifest.lock */ = { E4419DF1E8B742E49777FFE0 /* Check Pods Manifest.lock */ = {
......
...@@ -402,7 +402,7 @@ module Pod ...@@ -402,7 +402,7 @@ module Pod
# @return [void] # @return [void]
# #
def install_libraries def install_libraries
UI.message '- Installing libraries' do UI.message '- Installing targets' do
pod_targets.sort_by(&:name).each do |pod_target| pod_targets.sort_by(&:name).each do |pod_target|
next if pod_target.target_definition.empty? next if pod_target.target_definition.empty?
target_installer = PodTargetInstaller.new(sandbox, pod_target) target_installer = PodTargetInstaller.new(sandbox, pod_target)
......
...@@ -47,10 +47,10 @@ module Pod ...@@ -47,10 +47,10 @@ module Pod
def analyze(allow_fetches = true) def analyze(allow_fetches = true)
update_repositories_if_needed if allow_fetches update_repositories_if_needed if allow_fetches
@result = AnalysisResult.new @result = AnalysisResult.new
compute_target_platforms
@result.podfile_state = generate_podfile_state @result.podfile_state = generate_podfile_state
@locked_dependencies = generate_version_locking_dependencies @locked_dependencies = generate_version_locking_dependencies
compute_target_platforms
fetch_external_sources if allow_fetches fetch_external_sources if allow_fetches
@result.specs_by_target = resolve_dependencies @result.specs_by_target = resolve_dependencies
@result.specifications = generate_specifications @result.specifications = generate_specifications
...@@ -487,7 +487,7 @@ module Pod ...@@ -487,7 +487,7 @@ module Pod
# @todo Is assigning the platform to the target definition the best way # @todo Is assigning the platform to the target definition the best way
# to go? # to go?
# #
def compute_archs_for_target_definition(_target_definition, user_targets) def compute_archs_for_target_definition(target_definition, user_targets)
archs = [] archs = []
user_targets.each do |target| user_targets.each do |target|
target_archs = target.common_resolved_build_setting('ARCHS') target_archs = target.common_resolved_build_setting('ARCHS')
...@@ -495,7 +495,9 @@ module Pod ...@@ -495,7 +495,9 @@ module Pod
end end
archs = archs.compact.uniq.sort archs = archs.compact.uniq.sort
UI.puts("Using `ARCHS` setting to build architectures: (`#{archs.join('`, `')}`)") UI.message("Using `ARCHS` setting to build architectures of " \
"target `#{target_definition.label}`: " \
"(`#{archs.join('`, `')}`)")
archs.length > 1 ? archs : archs.first archs.length > 1 ? archs : archs.first
end end
...@@ -508,17 +510,19 @@ module Pod ...@@ -508,17 +510,19 @@ module Pod
# @return [void] # @return [void]
# #
def compute_target_platforms def compute_target_platforms
podfile.target_definition_list.each do |target_definition| UI.section 'Inspecting targets to integrate' do
if config.integrate_targets? podfile.target_definition_list.each do |target_definition|
project_path = compute_user_project_path(target_definition) if config.integrate_targets?
user_project = Xcodeproj::Project.open(project_path) project_path = compute_user_project_path(target_definition)
targets = compute_user_project_targets(target_definition, user_project) user_project = Xcodeproj::Project.open(project_path)
platform = compute_platform_for_target_definition(target_definition, targets) targets = compute_user_project_targets(target_definition, user_project)
archs = compute_archs_for_target_definition(target_definition, targets) platform = compute_platform_for_target_definition(target_definition, targets)
@archs_by_target_def[target_definition] = archs archs = compute_archs_for_target_definition(target_definition, targets)
else @archs_by_target_def[target_definition] = archs
unless target_definition.platform else
raise Informative, 'It is necessary to specify the platform in the Podfile if not integrating.' unless target_definition.platform
raise Informative, 'It is necessary to specify the platform in the Podfile if not integrating.'
end
end end
end end
end end
......
...@@ -21,8 +21,7 @@ module Pod ...@@ -21,8 +21,7 @@ module Pod
# Migrates from CocoaPods versions previous to 0.34. # Migrates from CocoaPods versions previous to 0.34.
# #
def migrate_to_0_34(sandbox) def migrate_to_0_34(sandbox)
title_options = { :verbose_prefix => '-> '.green } UI.message('Migrating to CocoaPods 0.34') do
UI.titled_section('Migrating to CocoaPods 0.34'.green, title_options) do
delete(sandbox.root + 'Headers') delete(sandbox.root + 'Headers')
make_path(sandbox.headers_root) make_path(sandbox.headers_root)
......
...@@ -70,12 +70,10 @@ module Pod ...@@ -70,12 +70,10 @@ module Pod
# #
def create_dummy_source def create_dummy_source
path = library.dummy_source_path path = library.dummy_source_path
UI.message "- Generating dummy source file at #{UI.path(path)}" do generator = Generator::DummySource.new(library.label)
generator = Generator::DummySource.new(library.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) target.source_build_phase.add_file_reference(file_reference)
target.source_build_phase.add_file_reference(file_reference)
end
end end
# @return [PBXNativeTarget] the target generated by the installation # @return [PBXNativeTarget] the target generated by the installation
......
...@@ -45,13 +45,11 @@ module Pod ...@@ -45,13 +45,11 @@ module Pod
def create_xcconfig_file def create_xcconfig_file
target.build_configurations.each do |configuration| target.build_configurations.each do |configuration|
path = library.xcconfig_path(configuration.name) path = library.xcconfig_path(configuration.name)
UI.message "- Generating #{configuration.name} xcconfig file at #{UI.path(path)}" do gen = Generator::XCConfig::AggregateXCConfig.new(library, configuration.name)
gen = Generator::XCConfig::AggregateXCConfig.new(library, configuration.name) gen.save_as(path)
gen.save_as(path) library.xcconfigs[configuration.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) configuration.base_configuration_reference = xcconfig_file_ref
configuration.base_configuration_reference = xcconfig_file_ref
end
end end
end end
...@@ -60,11 +58,9 @@ module Pod ...@@ -60,11 +58,9 @@ module Pod
# #
def create_target_environment_header def create_target_environment_header
path = library.target_environment_header_path path = library.target_environment_header_path
UI.message "- Generating target environment header at #{UI.path(path)}" do generator = Generator::TargetEnvironmentHeader.new(library.specs_by_build_configuration)
generator = Generator::TargetEnvironmentHeader.new(library.specs_by_build_configuration) generator.save_as(path)
generator.save_as(path) add_file_to_support_group(path)
add_file_to_support_group(path)
end
end end
# Generates the bridge support metadata if requested by the {Podfile}. # Generates the bridge support metadata if requested by the {Podfile}.
...@@ -78,13 +74,11 @@ module Pod ...@@ -78,13 +74,11 @@ 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?
path = library.bridge_support_path path = library.bridge_support_path
UI.message "- Generating BridgeSupport metadata at #{UI.path(path)}" do headers = target.headers_build_phase.files.map { |bf| sandbox.root + bf.file_ref.path }
headers = 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) add_file_to_support_group(path)
add_file_to_support_group(path) @bridge_support_file = path.relative_path_from(sandbox.root)
@bridge_support_file = path.relative_path_from(sandbox.root)
end
end end
end end
...@@ -98,18 +92,16 @@ module Pod ...@@ -98,18 +92,16 @@ module Pod
# #
def create_copy_resources_script def create_copy_resources_script
path = library.copy_resources_script_path path = library.copy_resources_script_path
UI.message "- Generating copy resources script at #{UI.path(path)}" do file_accessors = library.pod_targets.map(&:file_accessors).flatten
file_accessors = library.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 resources = []
resources = [] resources.concat(resource_paths)
resources.concat(resource_paths) resources.concat(resource_bundles)
resources.concat(resource_bundles) resources << bridge_support_file if bridge_support_file
resources << bridge_support_file if bridge_support_file generator = Generator::CopyResourcesScript.new(resources, library.platform)
generator = Generator::CopyResourcesScript.new(resources, library.platform) generator.save_as(path)
generator.save_as(path) add_file_to_support_group(path)
add_file_to_support_group(path)
end
end end
# Generates the acknowledgement files (markdown and plist) for the target. # Generates the acknowledgement files (markdown and plist) for the target.
...@@ -120,12 +112,10 @@ module Pod ...@@ -120,12 +112,10 @@ module Pod
basepath = library.acknowledgements_basepath basepath = library.acknowledgements_basepath
Generator::Acknowledgements.generators.each do |generator_class| Generator::Acknowledgements.generators.each do |generator_class|
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 = library.pod_targets.map(&:file_accessors).flatten
file_accessors = library.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) add_file_to_support_group(path)
add_file_to_support_group(path)
end
end end
end end
......
...@@ -33,17 +33,15 @@ module Pod ...@@ -33,17 +33,15 @@ module Pod
# @return [void] # @return [void]
# #
def add_files_to_build_phases def add_files_to_build_phases
UI.message '- Adding Build files' do library.file_accessors.each do |file_accessor|
library.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) all_source_files = file_accessor.source_files
all_source_files = file_accessor.source_files regular_source_files = all_source_files.reject { |sf| sf.extname == '.d' }
regular_source_files = all_source_files.reject { |sf| sf.extname == '.d' } regular_file_refs = regular_source_files.map { |sf| project.reference_for_path(sf) }
regular_file_refs = regular_source_files.map { |sf| project.reference_for_path(sf) } target.add_file_references(regular_file_refs, flags)
target.add_file_references(regular_file_refs, flags) other_file_refs = (all_source_files - regular_source_files).map { |sf| project.reference_for_path(sf) }
other_file_refs = (all_source_files - regular_source_files).map { |sf| project.reference_for_path(sf) } target.add_file_references(other_file_refs, nil)
target.add_file_references(other_file_refs, nil)
end
end end
end end
...@@ -55,24 +53,22 @@ module Pod ...@@ -55,24 +53,22 @@ 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 library.file_accessors.each do |file_accessor|
library.file_accessors.each do |file_accessor| file_accessor.resource_bundles.each do |bundle_name, paths|
file_accessor.resource_bundles.each do |bundle_name, paths| # Add a dependency on an existing Resource Bundle target if possible
# Add a dependency on an existing Resource Bundle target if possible if bundle_target = project.targets.find { |target| target.name == bundle_name }
if bundle_target = project.targets.find { |target| target.name == bundle_name }
target.add_dependency(bundle_target)
next
end
file_references = paths.map { |sf| project.reference_for_path(sf) }
bundle_target = project.new_resources_bundle(bundle_name, file_accessor.spec_consumer.platform_name)
bundle_target.add_resources(file_references)
library.user_build_configurations.each do |bc_name, type|
bundle_target.add_build_configuration(bc_name, type)
end
target.add_dependency(bundle_target) target.add_dependency(bundle_target)
next
end
file_references = paths.map { |sf| project.reference_for_path(sf) }
bundle_target = project.new_resources_bundle(bundle_name, file_accessor.spec_consumer.platform_name)
bundle_target.add_resources(file_references)
library.user_build_configurations.each do |bc_name, type|
bundle_target.add_build_configuration(bc_name, type)
end end
target.add_dependency(bundle_target)
end end
end end
end end
...@@ -84,20 +80,16 @@ module Pod ...@@ -84,20 +80,16 @@ module Pod
def create_xcconfig_file def create_xcconfig_file
path = library.xcconfig_path 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 public_gen.save_as(path)
public_gen.save_as(path) add_file_to_support_group(path)
add_file_to_support_group(path)
end
path = library.xcconfig_private_path path = library.xcconfig_private_path
private_gen = Generator::XCConfig::PrivatePodXCConfig.new(library, public_gen.xcconfig) private_gen = Generator::XCConfig::PrivatePodXCConfig.new(library, 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)
target.build_configurations.each do |c| target.build_configurations.each do |c|
c.base_configuration_reference = xcconfig_file_ref c.base_configuration_reference = xcconfig_file_ref
end
end end
end end
...@@ -109,16 +101,14 @@ module Pod ...@@ -109,16 +101,14 @@ module Pod
# #
def create_prefix_header def create_prefix_header
path = library.prefix_header_path path = library.prefix_header_path
UI.message "- Generating prefix header at #{UI.path(path)}" do generator = Generator::PrefixHeader.new(library.file_accessors, library.platform)
generator = Generator::PrefixHeader.new(library.file_accessors, library.platform) generator.imports << library.target_environment_header_path.basename
generator.imports << library.target_environment_header_path.basename generator.save_as(path)
generator.save_as(path) add_file_to_support_group(path)
add_file_to_support_group(path)
target.build_configurations.each do |c| target.build_configurations.each do |c|
relative_path = path.relative_path_from(project.path.dirname) relative_path = path.relative_path_from(project.path.dirname)
c.build_settings['GCC_PREFIX_HEADER'] = relative_path.to_s c.build_settings['GCC_PREFIX_HEADER'] = relative_path.to_s
end
end end
end end
......
...@@ -178,10 +178,8 @@ module Pod ...@@ -178,10 +178,8 @@ module Pod
# integration. # integration.
# #
def integration_message def integration_message
"Integrating Pod #{'target'.pluralize(target.pod_targets.size)} " \ "Integrating target `#{target.name}` " \
"`#{target.pod_targets.map(&:name).to_sentence}` " \ "(#{UI.path target.user_project_path} project)"
"into aggregate target #{target.name} " \
"of project #{UI.path target.user_project_path}."
end end
end end
end end
......
...@@ -175,10 +175,10 @@ module Pod ...@@ -175,10 +175,10 @@ module Pod
@sut.stubs(:validate_homepage) @sut.stubs(:validate_homepage)
WebMock::API. WebMock::API.
stub_request(:head, 'banana-corp.local/valid-image.png'). stub_request(:head, 'banana-corp.local/valid-image.png').
to_return({ to_return(
:status => 200, :status => 200,
:headers => { 'Content-Type' => 'image/png' } :headers => { 'Content-Type' => 'image/png' }
}) )
end end
it 'checks if the screenshots are valid' do it 'checks if the screenshots are valid' do
......
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