Commit 77d6a4a5 authored by Ben Asher's avatar Ben Asher Committed by GitHub

Merge pull request #5888 from benasher44/basher_fix_message_app

Remove special casing for messages apps
parents 520988c2 4d6c28ce
...@@ -15,8 +15,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -15,8 +15,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* None. * Remove special handling for messages apps
[Ben Asher](https://github.com/benasher44)
[#5860](https://github.com/CocoaPods/CocoaPods/issues/5860)
## 1.1.0.rc.2 (2016-09-13) ## 1.1.0.rc.2 (2016-09-13)
......
...@@ -281,11 +281,7 @@ module Pod ...@@ -281,11 +281,7 @@ module Pod
embedded_aggregate_targets.each do |target| embedded_aggregate_targets.each do |target|
host_uuids = [] host_uuids = []
aggregate_target_user_projects.product(target.user_targets).each do |user_project, user_target| 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_uuids += user_project.host_targets_for_embedded_target(user_target).map(&:uuid)
host_targets.map(&:symbol_type).each do |product_type|
target.add_host_target_product_type(product_type)
end
host_uuids += host_targets.map(&:uuid)
end end
# For each host, keep track of its embedded target definitions # For each host, keep track of its embedded target definitions
# to later verify each embedded target's compatiblity with its host, # to later verify each embedded target's compatiblity with its host,
......
...@@ -9,8 +9,6 @@ module Pod ...@@ -9,8 +9,6 @@ module Pod
# Product types where the product's frameworks must be embedded in a host target # 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 EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :messages_extension, :watch_extension].freeze
# Initialize a new instance # Initialize a new instance
...@@ -27,21 +25,6 @@ module Pod ...@@ -27,21 +25,6 @@ module Pod
@search_paths_aggregate_targets = [] @search_paths_aggregate_targets = []
@file_accessors = [] @file_accessors = []
@xcconfigs = {} @xcconfigs = {}
@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
# targets, in which this target will be embedded
#
# @param [Symbol] product_type Product type (symbol representation)
# of a host, in which this target will be embedded
#
# @note This is important for messages extensions, since a messages
# extension has its frameworks embedded in its host when
# its host is an app but not when it's a messages app
#
def add_host_target_product_type(product_type)
@host_target_types << product_type
end end
# @return [Boolean] True if the user_target's pods are # @return [Boolean] True if the user_target's pods are
...@@ -57,7 +40,7 @@ module Pod ...@@ -57,7 +40,7 @@ module Pod
return false if user_project.nil? return false if user_project.nil?
symbol_types = user_targets.map(&:symbol_type).uniq symbol_types = user_targets.map(&:symbol_type).uniq
raise ArgumentError, "Expected single kind of user_target for #{name}. Found #{symbol_types.join(', ')}." unless symbol_types.count == 1 raise ArgumentError, "Expected single kind of user_target for #{name}. Found #{symbol_types.join(', ')}." unless symbol_types.count == 1
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include?(symbol_types[0]) && !@host_target_types.include?(:messages_application) EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include?(symbol_types[0])
end end
# @return [String] the label for the target. # @return [String] the label for the target.
......
...@@ -224,12 +224,6 @@ module Pod ...@@ -224,12 +224,6 @@ module Pod
@target.requires_host_target?.should == true @target.requires_host_target?.should == true
end end
it 'does not require a host target for messages extension targets embedded in messages applications' do
@target.add_host_target_product_type(:messages_application)
@target.user_targets.first.stubs(:symbol_type).returns(:messages_extension)
@target.requires_host_target?.should == false
end
it 'does not require a host target for watch 2 extension targets' do it 'does not require a host target for watch 2 extension targets' do
@target.user_targets.first.stubs(:symbol_type).returns(:watch2_extension) @target.user_targets.first.stubs(:symbol_type).returns(:watch2_extension)
@target.requires_host_target?.should == false @target.requires_host_target?.should == false
......
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