Commit cfb74e5f authored by Fabio Pelosin's avatar Fabio Pelosin

[UI] Tune verbose output

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