Commit c89f74e9 authored by Samuel Giddins's avatar Samuel Giddins

[TargetIntegrator] Ensure the embed frameworks script is added to existing targets

parent 4ee54d23
...@@ -127,11 +127,16 @@ module Pod ...@@ -127,11 +127,16 @@ module Pod
# @todo This can be removed for CocoaPods 1.0 # @todo This can be removed for CocoaPods 1.0
# #
def update_to_cocoapods_0_39 def update_to_cocoapods_0_39
requires_update = native_targets_to_embed_in.any? do |target| targets_to_embed = native_targets.select do |target|
!target.shell_script_build_phases.find { |bp| bp.name == 'Embed Pods Frameworks' } EMBED_FRAMEWORK_TARGET_TYPES.include?(target.symbol_type)
end
requires_update = targets_to_embed.any? do |target|
!target.shell_script_build_phases.find { |bp| bp.name == EMBED_FRAMEWORK_PHASE_NAME }
end end
if requires_update if requires_update
add_embed_frameworks_script_phase targets_to_embed.each do |native_target|
add_embed_frameworks_script_phase_to_target(native_target)
end
end end
frameworks = user_project.frameworks_group frameworks = user_project.frameworks_group
...@@ -190,11 +195,15 @@ module Pod ...@@ -190,11 +195,15 @@ module Pod
# #
def add_embed_frameworks_script_phase def add_embed_frameworks_script_phase
native_targets_to_embed_in.each do |native_target| native_targets_to_embed_in.each do |native_target|
add_embed_frameworks_script_phase_to_target(native_target)
end
end
def add_embed_frameworks_script_phase_to_target(native_target)
phase = create_or_update_build_phase(native_target, EMBED_FRAMEWORK_PHASE_NAME) phase = create_or_update_build_phase(native_target, EMBED_FRAMEWORK_PHASE_NAME)
script_path = target.embed_frameworks_script_relative_path script_path = target.embed_frameworks_script_relative_path
phase.shell_script = %("#{script_path}"\n) phase.shell_script = %("#{script_path}"\n)
end end
end
# Delete a 'Embed Pods Frameworks' Copy Files Build Phase if present # Delete a 'Embed Pods Frameworks' Copy Files Build Phase if present
# #
......
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