Class: Fastlane::Helper::DynatraceSymlinkHelper

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb

Class Method Summary collapse

Class Method Details

.active_lldb_path(xcode_path) ⇒ Object



64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb', line 64

def self.active_lldb_path(xcode_path)
  unless xcode_path.end_with? "/Developer"
    UI.important "Could not find proper Xcode path!"
    UI.important "Output of `xcode-select --print-path` command is `#{xcode_path}`"
    UI.important "Please make sure your developer path ends with `/Developer`"
    return nil
  end

  parent_dir = File.dirname(xcode_path)
  return File.join(parent_dir, "SharedFrameworks", "LLDB.framework")
end


20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb', line 20

def self.auto_symlink_lldb(destination_path)
  require_path(destination_path)
  UI.message "Preparing to automatically symlink LLDB framework path to: #{destination_path}"
  current_xcode_path = %x(xcrun xcode-select --print-path).chomp
  active_lldb_path = active_lldb_path(current_xcode_path)
  if active_lldb_path.nil?
    UI.important "Could not find active LLDB framework path!"
  else
    UI.message "LLDB framework found at: #{active_lldb_path}"
    symlink(active_lldb_path, destination_path)
  end
end


33
34
35
36
37
38
39
40
41
# File 'lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb', line 33

def self.delete_existing_lldb_symlinks(destination_path)
  symlink_path = make_symlink_path_name(destination_path)
  if File.symlink?(symlink_path)
    UI.message "Deleting existing LLDB symlink: #{symlink_path}"
    FileUtils.rm(symlink_path)
  else
    UI.message "No existing LLDB symlink at destination: #{symlink_path}"
  end
end

.path_exists?(path) ⇒ Boolean

Returns:

  • (Boolean)


6
7
8
9
10
11
# File 'lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb', line 6

def self.path_exists?(path)
  unless path.nil?
    return Dir.exist?(path) || File.exist?(path)
  end
  return false
end


13
14
15
16
17
18
# File 'lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb', line 13

def self.symlink_custom_lldb(lldb_path, destination_path)
  require_path(destination_path)
  require_path(lldb_path)
  UI.message "Preparing to symlink custom LLDB framework path to: #{destination_path}"
  symlink(lldb_path, destination_path)
end