Commit 6fdf3d6d authored by Samuel E. Giddins's avatar Samuel E. Giddins

[Documentation] Document new FileAccessor methods

parent eab14a83
...@@ -53,7 +53,7 @@ module Pod ...@@ -53,7 +53,7 @@ module Pod
# #
def generate def generate
includes_static_libs = !target.requires_frameworks? includes_static_libs = !target.requires_frameworks?
includes_static_libs ||= pod_targets.flat_map(&:file_accessors).any? { |fa| !fa.vendored_static_libraries.empty? || !fa.vendored_static_frameworks.empty? } includes_static_libs ||= pod_targets.flat_map(&:file_accessors).any? { |fa| !fa.vendored_static_artifacts.empty? }
config = { config = {
'OTHER_LDFLAGS' => '$(inherited) ' + XCConfigHelper.default_ld_flags(target, includes_static_libs), 'OTHER_LDFLAGS' => '$(inherited) ' + XCConfigHelper.default_ld_flags(target, includes_static_libs),
'PODS_ROOT' => target.relative_pods_root, 'PODS_ROOT' => target.relative_pods_root,
......
...@@ -152,12 +152,18 @@ module Pod ...@@ -152,12 +152,18 @@ module Pod
paths_for_attribute(:vendored_frameworks, true) paths_for_attribute(:vendored_frameworks, true)
end end
# @return [Array<Pathname>] The paths of the dynamic framework bundles
# that come shipped with the Pod.
#
def vendored_dynamic_frameworks def vendored_dynamic_frameworks
vendored_frameworks.select do |framework| vendored_frameworks.select do |framework|
dynamic_binary?(framework + framework.basename('.*')) dynamic_binary?(framework + framework.basename('.*'))
end end
end end
# @return [Array<Pathname>] The paths of the static (fake) framework
# bundles that come shipped with the Pod.
#
def vendored_static_frameworks def vendored_static_frameworks
vendored_frameworks - vendored_dynamic_frameworks vendored_frameworks - vendored_dynamic_frameworks
end end
...@@ -197,20 +203,32 @@ module Pod ...@@ -197,20 +203,32 @@ module Pod
paths_for_attribute(:vendored_libraries) paths_for_attribute(:vendored_libraries)
end end
# @return [Array<Pathname>] The paths of the dynamic libraries
# that come shipped with the Pod.
#
def vendored_dynamic_libraries def vendored_dynamic_libraries
vendored_libraries.select do |library| vendored_libraries.select do |library|
dynamic_binary?(library) dynamic_binary?(library)
end end
end end
# @return [Array<Pathname>] The paths of the static libraries
# that come shipped with the Pod.
#
def vendored_static_libraries def vendored_static_libraries
vendored_libraries - vendored_dynamic_libraries vendored_libraries - vendored_dynamic_libraries
end end
# @return [Array<Pathname>] The paths of the dynamic binary artifacts
# that come shipped with the Pod.
#
def vendored_dynamic_artifacts def vendored_dynamic_artifacts
vendored_dynamic_libraries + vendored_dynamic_frameworks vendored_dynamic_libraries + vendored_dynamic_frameworks
end end
# @return [Array<Pathname>] The paths of the static binary artifacts
# that come shipped with the Pod.
#
def vendored_static_artifacts def vendored_static_artifacts
vendored_static_libraries + vendored_static_frameworks vendored_static_libraries + vendored_static_frameworks
end end
...@@ -343,6 +361,11 @@ module Pod ...@@ -343,6 +361,11 @@ module Pod
result.flatten.compact.uniq result.flatten.compact.uniq
end end
# @param [Pathname] binary
# The file to be checked for being a dynamic Mach-O binary.
#
# @return [Boolean] Whether `binary` can be dynamically linked.
#
def dynamic_binary?(binary) def dynamic_binary?(binary)
return unless binary.file? return unless binary.file?
output, status = Executable.capture_command('file', [binary], :capture => :out) output, status = Executable.capture_command('file', [binary], :capture => :out)
......
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