Class: Pod::PrebuildSandbox

Inherits:
Sandbox
  • Object
show all
Defined in:
lib/cocoapods-binary-gcp/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-gcp/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-gcp/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



37
38
39
# File 'lib/cocoapods-binary-gcp/helper/prebuild_sandbox.rb', line 37

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



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

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

#exsited_framework_target_namesObject



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

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-gcp/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-gcp/helper/prebuild_sandbox.rb', line 20

def generate_framework_path
    self.root + "GeneratedFrameworks"
end

#save_pod_name_for_target(target) ⇒ Object



43
44
45
46
47
48
# File 'lib/cocoapods-binary-gcp/helper/prebuild_sandbox.rb', line 43

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

#standard_sanbox_pathObject



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

def standard_sanbox_path
    self.root.parent
end