[FileAccessor] Use ruby-macho to determine whether binaries are dynamic or not

parent 5323bdb3
...@@ -120,6 +120,7 @@ PATH ...@@ -120,6 +120,7 @@ PATH
gh_inspector (~> 1.0) gh_inspector (~> 1.0)
molinillo (~> 0.5.1, != 0.5.2) molinillo (~> 0.5.1, != 0.5.2)
nap (~> 1.0) nap (~> 1.0)
ruby-macho (~> 0.2.5)
xcodeproj (>= 1.3.3, < 2.0) xcodeproj (>= 1.3.3, < 2.0)
GEM GEM
...@@ -229,6 +230,7 @@ GEM ...@@ -229,6 +230,7 @@ GEM
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (~> 0.3) unicode-display_width (~> 0.3)
ruby-graphviz (1.2.2) ruby-graphviz (1.2.2)
ruby-macho (0.2.5)
ruby-prof (0.15.2) ruby-prof (0.15.2)
ruby-progressbar (1.7.5) ruby-progressbar (1.7.5)
safe_yaml (1.0.4) safe_yaml (1.0.4)
......
...@@ -47,6 +47,7 @@ Gem::Specification.new do |s| ...@@ -47,6 +47,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'fourflusher', '~> 2.0.1' s.add_runtime_dependency 'fourflusher', '~> 2.0.1'
s.add_runtime_dependency 'gh_inspector', '~> 1.0' s.add_runtime_dependency 'gh_inspector', '~> 1.0'
s.add_runtime_dependency 'nap', '~> 1.0' s.add_runtime_dependency 'nap', '~> 1.0'
s.add_runtime_dependency 'ruby-macho', '~> 0.2.5'
s.add_development_dependency 'bacon', '~> 1.1' s.add_development_dependency 'bacon', '~> 1.1'
s.add_development_dependency 'bundler', '~> 1.3' s.add_development_dependency 'bundler', '~> 1.3'
......
autoload :MachO, 'macho'
module Pod module Pod
class Sandbox class Sandbox
# Resolves the file patterns of a specification against its root directory, # Resolves the file patterns of a specification against its root directory,
...@@ -371,8 +373,9 @@ module Pod ...@@ -371,8 +373,9 @@ module Pod
# #
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) MachO.open(binary).dylib?
status.success? && output =~ /dynamically linked/ rescue MachO::MachOError
false
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