Skip to content

Commit

Permalink
Merge pull request #5888 from benasher44/basher_fix_message_app
Browse files Browse the repository at this point in the history
Remove special casing for messages apps
  • Loading branch information
benasher44 committed Sep 20, 2016
2 parents 520988c + 4d6c28c commit 77d6a4a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
5 changes: 3 additions & 2 deletions CHANGELOG.md
Expand Up @@ -15,8 +15,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`

##### 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)

Expand Down
6 changes: 1 addition & 5 deletions lib/cocoapods/installer/analyzer.rb
Expand Up @@ -281,11 +281,7 @@ def analyze_host_targets_in_podfile(aggregate_targets, embedded_aggregate_target
embedded_aggregate_targets.each do |target|
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(&:symbol_type).each do |product_type|
target.add_host_target_product_type(product_type)
end
host_uuids += host_targets.map(&:uuid)
host_uuids += user_project.host_targets_for_embedded_target(user_target).map(&:uuid)
end
# For each host, keep track of its embedded target definitions
# to later verify each embedded target's compatiblity with its host,
Expand Down
19 changes: 1 addition & 18 deletions lib/cocoapods/target/aggregate_target.rb
Expand Up @@ -9,8 +9,6 @@ class AggregateTarget < 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

# Initialize a new instance
Expand All @@ -27,21 +25,6 @@ def initialize(target_definition, sandbox)
@search_paths_aggregate_targets = []
@file_accessors = []
@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

# @return [Boolean] True if the user_target's pods are
Expand All @@ -57,7 +40,7 @@ def requires_host_target?
return false if user_project.nil?
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
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

# @return [String] the label for the target.
Expand Down
6 changes: 0 additions & 6 deletions spec/unit/target/aggregate_target_spec.rb
Expand Up @@ -224,12 +224,6 @@ module Pod
@target.requires_host_target?.should == true
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
@target.user_targets.first.stubs(:symbol_type).returns(:watch2_extension)
@target.requires_host_target?.should == false
Expand Down

0 comments on commit 77d6a4a

Please sign in to comment.