Class: Fastlane::Helper::DynatraceSymlinkHelper
- Inherits:
-
Object
- Object
- Fastlane::Helper::DynatraceSymlinkHelper
- Defined in:
- lib/fastlane/plugin/dynatrace/helper/dynatrace_symlink_helper.rb
Class Method Summary collapse
- .active_lldb_path(xcode_path) ⇒ Object
- .auto_symlink_lldb(destination_path) ⇒ Object
- .delete_existing_lldb_symlinks(destination_path) ⇒ Object
- .path_exists?(path) ⇒ Boolean
- .symlink_custom_lldb(lldb_path, destination_path) ⇒ Object
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 |
.auto_symlink_lldb(destination_path) ⇒ Object
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. "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. "LLDB framework found at: #{active_lldb_path}" symlink(active_lldb_path, destination_path) end end |
.delete_existing_lldb_symlinks(destination_path) ⇒ Object
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. "Deleting existing LLDB symlink: #{symlink_path}" FileUtils.rm(symlink_path) else UI. "No existing LLDB symlink at destination: #{symlink_path}" end end |
.path_exists?(path) ⇒ 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 |
.symlink_custom_lldb(lldb_path, destination_path) ⇒ Object
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. "Preparing to symlink custom LLDB framework path to: #{destination_path}" symlink(lldb_path, destination_path) end |