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
#
def generate
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 = {
'OTHER_LDFLAGS' => '$(inherited) ' + XCConfigHelper.default_ld_flags(target, includes_static_libs),
'PODS_ROOT' => target.relative_pods_root,
......
......@@ -152,12 +152,18 @@ module Pod
paths_for_attribute(:vendored_frameworks, true)
end
# @return [Array<Pathname>] The paths of the dynamic framework bundles
# that come shipped with the Pod.
#
def vendored_dynamic_frameworks
vendored_frameworks.select do |framework|
dynamic_binary?(framework + framework.basename('.*'))
end
end
# @return [Array<Pathname>] The paths of the static (fake) framework
# bundles that come shipped with the Pod.
#
def vendored_static_frameworks
vendored_frameworks - vendored_dynamic_frameworks
end
......@@ -197,20 +203,32 @@ module Pod
paths_for_attribute(:vendored_libraries)
end
# @return [Array<Pathname>] The paths of the dynamic libraries
# that come shipped with the Pod.
#
def vendored_dynamic_libraries
vendored_libraries.select do |library|
dynamic_binary?(library)
end
end
# @return [Array<Pathname>] The paths of the static libraries
# that come shipped with the Pod.
#
def vendored_static_libraries
vendored_libraries - vendored_dynamic_libraries
end
# @return [Array<Pathname>] The paths of the dynamic binary artifacts
# that come shipped with the Pod.
#
def vendored_dynamic_artifacts
vendored_dynamic_libraries + vendored_dynamic_frameworks
end
# @return [Array<Pathname>] The paths of the static binary artifacts
# that come shipped with the Pod.
#
def vendored_static_artifacts
vendored_static_libraries + vendored_static_frameworks
end
......@@ -343,6 +361,11 @@ module Pod
result.flatten.compact.uniq
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)
return unless binary.file?
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