Commit a0ccef9a authored by AliSoftware's avatar AliSoftware

[xcassets] Removing debug traces

parent 3f54a47d
...@@ -130,7 +130,6 @@ module Pod ...@@ -130,7 +130,6 @@ module Pod
def clean_deintegrated_targets_resources(project, target_uuids_to_keep) def clean_deintegrated_targets_resources(project, target_uuids_to_keep)
is_dirty = false is_dirty = false
TargetIntegrator.each_pods_resources(project) do |file_ref| TargetIntegrator.each_pods_resources(project) do |file_ref|
puts "Analyzing Pods/Resources/#{file_ref}"
file_in_at_least_one_target = false file_in_at_least_one_target = false
project.targets.each do |user_target| project.targets.each do |user_target|
# Seems like user_target.resources_build_phase.include?(file_ref) does not work as expected here :( # Seems like user_target.resources_build_phase.include?(file_ref) does not work as expected here :(
...@@ -140,9 +139,7 @@ module Pod ...@@ -140,9 +139,7 @@ module Pod
if target_uuids_to_keep.include?(user_target.uuid) if target_uuids_to_keep.include?(user_target.uuid)
# This target is one to integrate, the resource will be kept in there # This target is one to integrate, the resource will be kept in there
file_in_at_least_one_target = true file_in_at_least_one_target = true
UI.puts " - Should be kept in for target #{user_target}"
else else
UI.puts " - Removing #{file_ref} from #{user_target} because target not integrated anymore."
user_target.resources_build_phase.remove_file_reference(file_ref) user_target.resources_build_phase.remove_file_reference(file_ref)
is_dirty = true is_dirty = true
end end
...@@ -151,7 +148,6 @@ module Pod ...@@ -151,7 +148,6 @@ module Pod
unless file_in_at_least_one_target unless file_in_at_least_one_target
# TODO: Remove the file_refs in Pods/Resources if they are not linked # TODO: Remove the file_refs in Pods/Resources if they are not linked
# to any native_target anymore (which can happen after a target deintegration) # to any native_target anymore (which can happen after a target deintegration)
UI.puts " -> File #{file_ref} is not in any user target anymore, remove it from the project"
file_ref.remove_from_project file_ref.remove_from_project
is_dirty = true is_dirty = true
end end
......
...@@ -138,9 +138,6 @@ module Pod ...@@ -138,9 +138,6 @@ module Pod
def add_pods_resources def add_pods_resources
dirty = false dirty = false
UI.puts "- User targets being integrated: #{native_targets.map(&:name).inspect}"
UI.puts "- Pod Targets = #{target.pod_targets.map(&:name)}"
pods_group = user_project['Pods'] pods_group = user_project['Pods']
resources_group = pods_group ? pods_group['Resources'] : nil resources_group = pods_group ? pods_group['Resources'] : nil
# The files already in the target before integration # The files already in the target before integration
...@@ -158,7 +155,6 @@ module Pod ...@@ -158,7 +155,6 @@ module Pod
pod_name = pod_target.pod_name pod_name = pod_target.pod_name
resource_files = pod_target.file_accessors.flat_map(&:resources) resource_files = pod_target.file_accessors.flat_map(&:resources)
resource_files.each do |resource_path| resource_files.each do |resource_path|
UI.puts " - Adding #{resource_path} to user project"
relative_path = resource_path.relative_path_from(target.client_root).to_s relative_path = resource_path.relative_path_from(target.client_root).to_s
pods_group ||= ((dirty = true) && user_project.new_group('Pods')) pods_group ||= ((dirty = true) && user_project.new_group('Pods'))
...@@ -167,7 +163,6 @@ module Pod ...@@ -167,7 +163,6 @@ module Pod
file_ref = pod_subgroup.files.find { |f| f.path == relative_path } file_ref = pod_subgroup.files.find { |f| f.path == relative_path }
file_ref ||= (dirty = true) && pod_subgroup.new_file(relative_path) file_ref ||= (dirty = true) && pod_subgroup.new_file(relative_path)
UI.puts " - Adding #{resource_path.basename} to targets #{native_targets.map(&:name)}"
native_targets.each do |user_target| native_targets.each do |user_target|
refs_to_remove.delete(file_ref) # this file_ref is still needed, don't remove it later refs_to_remove.delete(file_ref) # this file_ref is still needed, don't remove it later
unless user_target.resources_build_phase.include?(file_ref) unless user_target.resources_build_phase.include?(file_ref)
...@@ -181,16 +176,11 @@ module Pod ...@@ -181,16 +176,11 @@ module Pod
# Remove the resources no longer in a target # Remove the resources no longer in a target
refs_to_remove.each do |file_ref| refs_to_remove.each do |file_ref|
native_targets.each do |user_target| native_targets.each do |user_target|
UI.puts " - Removing #{file_ref} from #{user_target} because it is no longer needed."
user_target.resources_build_phase.remove_file_reference(file_ref) user_target.resources_build_phase.remove_file_reference(file_ref)
dirty = true dirty = true
end end
end end
# TODO: Change code in FileReferencesInstaller#add_resource to stop adding resources to the Pods.xcodeproj
# TODO: Remove code from Pods-resources.sh (except for *.framework stuff still needed)
UI.puts "==> User project dirty? #{dirty.inspect}"
dirty dirty
end end
...@@ -201,7 +191,6 @@ module Pod ...@@ -201,7 +191,6 @@ module Pod
def remove_pods_resources def remove_pods_resources
TargetIntegrator.each_pods_resources(user_project) do |file_ref| TargetIntegrator.each_pods_resources(user_project) do |file_ref|
native_targets.each do |user_target| native_targets.each do |user_target|
UI.puts " - Removing #{file_ref} from #{user_target} because it is no longer needed."
user_target.resources_build_phase.remove_file_reference(file_ref) user_target.resources_build_phase.remove_file_reference(file_ref)
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