Commit a7e32afd authored by Marius Rackwitz's avatar Marius Rackwitz

[TargetIntegrator] Extract removing build phase

Create an own method #remove_embed_frameworks_script_phase which takes a native target and returns whether modification were made.
parent 96dd6ff5
...@@ -161,17 +161,22 @@ module Pod ...@@ -161,17 +161,22 @@ module Pod
# #
def remove_embed_frameworks_script_phases def remove_embed_frameworks_script_phases
return false if target.requires_frameworks? return false if target.requires_frameworks?
native_targets.any? do |native_target|
remove_embed_frameworks_script_phase(native_target)
end
end
result = false # Delete a 'Embed Pods Frameworks' Copy Files Build Phase if present
#
native_targets.each do |native_target| # @param [PBXNativeTarget] native_target
#
# @return [Bool] whether any changes to the project were made.
#
def remove_embed_frameworks_script_phase(native_target)
embed_build_phase = native_target.shell_script_build_phases.find { |bp| bp.name == EMBED_FRAMEWORK_PHASE_NAME } embed_build_phase = native_target.shell_script_build_phases.find { |bp| bp.name == EMBED_FRAMEWORK_PHASE_NAME }
next unless embed_build_phase.present? return false unless embed_build_phase.present?
native_target.build_phases.delete(embed_build_phase) native_target.build_phases.delete(embed_build_phase)
result = true true
end
result
end end
# Adds a shell script build phase responsible to copy the resources # Adds a shell script build phase responsible to copy the resources
......
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