Commit faab948e authored by Samuel Giddins's avatar Samuel Giddins

[PodTarget] Refactor #platform & document

parent 3198bde0
...@@ -88,28 +88,30 @@ module Pod ...@@ -88,28 +88,30 @@ module Pod
end end
end end
# The deployment target for the pod target, which is the maximum of all # @note The deployment target for the pod target is the maximum of all
# the deployment targets for the current platform of the target. # the deployment targets for the current platform of the target
# (or the minimum required to support the current installation
# strategy, if higher).
# #
# @return [String] The deployment target. # @return [Platform] the platform for this target.
# #
def platform def platform
@platform ||= begin @platform ||= begin
platform_name = target_definitions.first.platform.name platform_name = target_definitions.first.platform.name
default = Podfile::TargetDefinition::PLATFORM_DEFAULTS[platform_name] default = Podfile::TargetDefinition::PLATFORM_DEFAULTS[platform_name]
deployment_target = specs.map do |spec| deployment_target = specs.map do |spec|
version = Pod::Version.new(spec.deployment_target(platform_name) || default) Version.new(spec.deployment_target(platform_name) || default)
end.max
if platform_name == :ios && requires_frameworks? if platform_name == :ios && requires_frameworks?
minimum = Version.new('8.0') minimum = Version.new('8.0')
version = [version, minimum].max deployment_target = [deployment_target, minimum].max
end end
version
end.max
Platform.new(platform_name, deployment_target) Platform.new(platform_name, deployment_target)
end end
end end
# @visibility private # @visibility private
#
attr_writer :platform attr_writer :platform
# @return [Podfile] The podfile which declares the dependency. # @return [Podfile] The podfile which declares the dependency.
......
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