Class: Pod::PrebuildSandbox

Inherits:
Sandbox
  • Object
show all
Defined in:
lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_standard_sanbox_path(path) ⇒ Object

String

standard_sandbox_path



7
8
9
10
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 7

def self.from_standard_sanbox_path(path)
    prebuild_sandbox_path = Pathname.new(path).realpath + "_Prebuild"
    self.new(prebuild_sandbox_path)
end

.from_standard_sandbox(sandbox) ⇒ Object



12
13
14
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 12

def self.from_standard_sandbox(sandbox)
    self.from_standard_sanbox_path(sandbox.root)
end

Instance Method Details

#existed_target_names_for_pod_name(pod_name) ⇒ Object



46
47
48
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 46

def existed_target_names_for_pod_name(pod_name)
    exsited_framework_name_pairs.select {|pair| pair[1] == pod_name }.map { |pair| pair[0]}
end

#exsited_framework_pod_namesObject



43
44
45
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 43

def exsited_framework_pod_names
    exsited_framework_name_pairs.map {|pair| pair[1]}.uniq
end

#exsited_framework_target_namesObject



40
41
42
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 40

def exsited_framework_target_names
    exsited_framework_name_pairs.map {|pair| pair[0]}.uniq
end

#framework_folder_path_for_target_name(name) ⇒ Pathname

Returns the folder containing the framework file.

Parameters:

  • name (String)

    pass the target.name (may containing platform suffix)

Returns:

  • (Pathname)

    the folder containing the framework file.



26
27
28
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 26

def framework_folder_path_for_target_name(name)
    self.generate_framework_path + name
end

#generate_framework_pathObject



20
21
22
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 20

def generate_framework_path
    self.root + "GeneratedFrameworks"
end

#plist_path_for_target_name(name) ⇒ Object



30
31
32
33
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 30

def plist_path_for_target_name(name)
    framework_path = framework_folder_path_for_target_name(name)
    "#{framework_path}/#{name}.framework/Info.plist"
end

#save_pod_name_for_target(target) ⇒ Object



52
53
54
55
56
57
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 52

def save_pod_name_for_target(target)
    folder = framework_folder_path_for_target_name(target.name)
    return unless folder.exist?
    flag_file_path = folder + "#{target.pod_name}.pod_name"
    File.write(flag_file_path.to_s, "")
end

#source_framework_path(name) ⇒ Object



35
36
37
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 35

def source_framework_path(name)
    self.root + name
end

#standard_sanbox_pathObject



16
17
18
# File 'lib/cocoapods-binary-bugfix/helper/prebuild_sandbox.rb', line 16

def standard_sanbox_path
    self.root.parent
end