Commit c4f5b5b5 authored by Ben Asher's avatar Ben Asher

fixed more messages extension edge cases

parent 69ed45ab
......@@ -274,7 +274,7 @@ module Pod
host_uuids = []
aggregate_target_user_projects.product(target.user_targets).each do |user_project, user_target|
host_targets = user_project.host_targets_for_embedded_target(user_target)
host_targets.map(&:product_type).each do |product_type|
host_targets.map(&:symbol_type).each do |product_type|
target.add_host_target_product_type(product_type)
end
host_uuids += host_targets.map(&:uuid)
......
......@@ -21,9 +21,11 @@ module Pod
# frameworks are embedded in the output directory / product bundle.
#
# @note This does not include :app_extension or :watch_extension because
# these types must have their frameworks embedded in their host targets
# these types must have their frameworks embedded in their host targets.
# For messages extensions, this only applies if it's embedded in a messages
# application.
#
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :ui_test_bundle, :watch2_extension].freeze
EMBED_FRAMEWORK_TARGET_TYPES = [:application, :unit_test_bundle, :ui_test_bundle, :watch2_extension, :messages_extension].freeze
# @return [String] the name of the embed frameworks phase
#
......@@ -121,6 +123,7 @@ module Pod
# will have their frameworks embedded in their host targets.
#
def remove_embed_frameworks_script_phase_from_embedded_targets
return unless target.requires_host_target?
native_targets.each do |native_target|
if AggregateTarget::EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include? native_target.symbol_type
remove_embed_frameworks_script_phase(native_target)
......@@ -201,6 +204,7 @@ module Pod
# directory / product bundle.
#
def native_targets_to_embed_in
return [] if target.requires_host_target?
native_targets.select do |target|
EMBED_FRAMEWORK_TARGET_TYPES.include?(target.symbol_type)
end
......
......@@ -8,6 +8,9 @@ module Pod
attr_reader :target_definition
# Product types where the product's frameworks must be embedded in a host target
#
# @note :messages_extension only applies when it is embedded in an app (as opposed to a messages app)
#
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :messages_extension, :watch_extension].freeze
# Initialize a new instance
......@@ -24,7 +27,7 @@ module Pod
@search_paths_aggregate_targets = []
@file_accessors = []
@xcconfigs = {}
@host_target_types = [] # Product types of the host target, if this target is embedded
@host_target_types = Set.new # Product types of the host target, if this target is embedded
end
# Adds product type to the list of product types for the host
......
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