Commit 2480a10a authored by Marius Rackwitz's avatar Marius Rackwitz

Auto opt-in OSX targets and iOS targets which have a deployment target >= 8.0

parent 7382c13e
...@@ -204,7 +204,7 @@ module Pod ...@@ -204,7 +204,7 @@ module Pod
user_project = Xcodeproj::Project.open(project_path) user_project = Xcodeproj::Project.open(project_path)
native_targets = compute_user_project_targets(target_definition, user_project) native_targets = compute_user_project_targets(target_definition, user_project)
target.host_requires_framework |= compute_user_project_targets_require_framework(native_targets) target.host_requires_framework |= compute_user_project_targets_require_framework(target_definition, native_targets)
target.user_project_path = project_path target.user_project_path = project_path
target.client_root = project_path.dirname target.client_root = project_path.dirname
target.user_target_uuids = native_targets.map(&:uuid) target.user_target_uuids = native_targets.map(&:uuid)
...@@ -568,14 +568,17 @@ module Pod ...@@ -568,14 +568,17 @@ module Pod
# by #compute_user_project_targets require to be build as a framework due # by #compute_user_project_targets require to be build as a framework due
# the presence of Swift source code in any of the source build phases. # the presence of Swift source code in any of the source build phases.
# #
# @param [TargetDefinition] target_definition
# the target definition
#
# @param [Array<PBXNativeTarget>] native_targets # @param [Array<PBXNativeTarget>] native_targets
# the targets which are checked for presence of Swift source code # the targets which are checked for presence of Swift source code
# #
# @return [Boolean] Whether the user project targets to integrate into # @return [Boolean] Whether the user project targets to integrate into
# uses Swift # uses Swift
# #
def compute_user_project_targets_require_framework(native_targets) def compute_user_project_targets_require_framework(target_definition, native_targets)
native_targets.any? do |target| target_definition.platform.supports_dynamic_frameworks? || native_targets.any? do |target|
target.source_build_phase.files.any? { |f| f.file_ref.last_known_file_type == 'sourcecode.swift' } target.source_build_phase.files.any? { |f| f.file_ref.last_known_file_type == 'sourcecode.swift' }
end end
end end
......
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