lib/cocoapods-jxedt/binary/prebuild.rb in cocoapods-jxedt-0.0.19 vs lib/cocoapods-jxedt/binary/prebuild.rb in cocoapods-jxedt-0.0.20
- old
+ new
@@ -1,33 +1,33 @@
module Jxedt
- class Sandbox
- attr_accessor :sandbox
+ class BinarySandbox
+ attr_accessor :standard_sandbox
def initialize(path=nil)
@sandbox_path = path
end
def self.from_sandbox(sandbox)
search_path = Jxedt.config.binary_dir
binary_dir = search_path.empty? ? nil : sandbox.standard_sandbox_root + search_path
- check_sandbox = Sandbox.new(binary_dir)
- check_sandbox.sandbox = sandbox
- check_sandbox
+ binary_sandbox = BinarySandbox.new(binary_dir)
+ binary_sandbox.standard_sandbox = sandbox
+ binary_sandbox
end
def binary_dir
@binary_dir ||= Pathname.new(@sandbox_path)
end
def target_paths
return [] if @sandbox_path.nil?
return [] unless binary_dir.exist?
- return [] if @sandbox.source_lockfile.nil?
+ return [] if @standard_sandbox.source_lockfile.nil?
@targets ||= begin
prebuild_targets = binary_dir.children().map do |target_path|
if target_path.directory? && (not target_path.children.empty?)
- hash_key = @sandbox.source_lockfile.spec_checksums_hash_key(target_path.basename.to_s)
+ hash_key = @standard_sandbox.source_lockfile.spec_checksums_hash_key(target_path.basename.to_s)
next if hash_key.nil?
checksum_files = target_path.children().select { |path| path.extname == '.checksum' }
checksum_exists = (target_path + "#{hash_key}.checksum").exist?
target_path if checksum_files.count == 1 && checksum_exists
@@ -124,11 +124,11 @@
}
targets
end
def build
- check_sandbox = Jxedt::Sandbox.from_sandbox(@source_installer.sandbox)
- existed_target_names = check_sandbox.target_paths.map { |pair| pair.basename.to_s }
+ binary_sandbox = Jxedt::BinarySandbox.from_sandbox(@source_installer.sandbox)
+ existed_target_names = binary_sandbox.target_paths.map { |pair| pair.basename.to_s }
targets = targets_to_prebuild.reject { |target| existed_target_names.include?(target.name.to_s) }
Pod::UI.puts "Prebuild total count: #{targets.size}"
Pod::UI.puts "Prebuild targets: #{ targets.map(&:name)}"
return [] if targets.empty?
\ No newline at end of file