Skip to content

Commit

Permalink
improve messages of autosymlink feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ozantepe committed Feb 7, 2024
1 parent 7f7c40f commit 2e04de1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
19 changes: 11 additions & 8 deletions lib/fastlane/plugin/dynatrace/actions/dynatrace_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def self.run(params)
UI.message "Server URL: #{params[:server]}"
UI.message "Tempdir: #{params[:tempdir]}"
UI.message "Symbols file path: #{params[:symbolsfile]}"
UI.message "Custom LLDB framework path: #{params[:customLLDBFrameworkPath]}"
UI.message "Auto symlink LLDB: #{params[:autoSymlinkLLDB]}"

UI.message "Checking AppFile for possible AppID"
bundleId = CredentialsManager::AppfileConfig.try_fetch_value(:app_identifier)
Expand Down Expand Up @@ -67,16 +65,21 @@ def self.run(params)
Helper::DynatraceSymlinkHelper.delete_existing_lldb_symlinks(dtxDssClientDir)

customLLDBFrameworkPath = params[:customLLDBFrameworkPath]
if not customLLDBFrameworkPath.nil?
if customLLDBFrameworkPath.nil?
UI.message "No custom LLDB framework path provided"
if params[:autoSymlinkLLDB]
UI.message "Automatic LLDB symlink creation enabled"
Helper::DynatraceSymlinkHelper.auto_symlink_lldb(dtxDssClientDir)
elsif
UI.message "Automatic LLDB symlink creation disabled"
end
else
if Helper::DynatraceSymlinkHelper.path_exists?(customLLDBFrameworkPath)
UI.message "Custom LLDB Framework path found at: #{customLLDBFrameworkPath}"
UI.message "Custom LLDB framework path `#{customLLDBFrameworkPath}` exists."
Helper::DynatraceSymlinkHelper.symlink_custom_lldb(customLLDBFrameworkPath, dtxDssClientDir)
else
UI.message "Custom LLDB Framework path set, but the path does not exist: #{customLLDBFrameworkPath}"
UI.user_error! "Custom LLDB framework path `#{customLLDBFrameworkPath}` does not exist!"
end
elsif params[:autoSymlinkLLDB]
UI.message "Automatic LLDB symlink creation enabled"
Helper::DynatraceSymlinkHelper.auto_symlink_lldb(dtxDssClientDir)
end

# start constructing the command that will trigger the DTXDssClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ def self.auto_symlink_lldb(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)
unless active_lldb_path.nil?
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
Expand Down Expand Up @@ -61,7 +63,9 @@ def self.symlink(source, destination)

def self.active_lldb_path(xcode_path)
unless xcode_path.end_with? "/Developer"
UI.important "Could not find proper Xcode path. It should end `.../Developer`, but got: #{xcode_path}"
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

Expand Down

0 comments on commit 2e04de1

Please sign in to comment.