Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[upload_symbols_to_crashlytics] add support for debug flag #16745

Merged
merged 2 commits into from
Jul 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ def self.upload_dsym(params, path)
UI.message("Uploading '#{path}'...")
command = []
command << File.expand_path(params[:binary_path]).shellescape
if params[:debug]
command << "-d"
end
if params[:app_id]
command << "-ai #{params[:app_id].shellescape}"
elsif params[:gsp_path]
Expand All @@ -68,7 +71,7 @@ def self.upload_dsym(params, path)
begin
command_to_execute = command.join(" ")
UI.verbose("upload_dsym using command: #{command_to_execute}")
Actions.sh(command_to_execute, log: false)
Actions.sh(command_to_execute, log: params[:debug])
rescue => ex
UI.error(ex.to_s) # it fails, however we don't want to fail everything just for this
end
Expand Down Expand Up @@ -189,7 +192,12 @@ def self.available_options
verify_block: proc do |value|
min_threads = 1
UI.user_error!("Too few threads (#{value}) minimum number of threads: #{min_threads}") unless value >= min_threads
end)
end),
FastlaneCore::ConfigItem.new(key: :debug,
env_name: "FL_UPLOAD_SYMBOLS_TO_CRASHLYTICS_DEBUG",
description: "Enable debug mode for upload-symbols",
type: Boolean,
default_value: false)
]
end

Expand Down
23 changes: 23 additions & 0 deletions fastlane/spec/actions_specs/upload_symbols_to_crashlytics_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,29 @@
end").runner.execute(:test)
end

it "uploads dSYM files with platform and debug params" do
dsym_path = './spec/fixtures/dSYM/Themoji.dSYM'
binary_path = './spec/fixtures/screenshots/screenshot1.png'
gsp_path = './spec/fixtures/plist/GoogleService-Info.plist'

command = []
command << File.expand_path(File.join("fastlane", binary_path)).shellescape
command << "-d"
command << "-gsp #{File.expand_path(File.join('fastlane', gsp_path)).shellescape}"
command << "-p tvos"
command << File.expand_path(File.join("fastlane", dsym_path)).shellescape

expect(Fastlane::Actions).to receive(:sh).with(command.join(" "), log: true)

Fastlane::FastFile.new.parse("lane :test do
upload_symbols_to_crashlytics(
dsym_path: 'fastlane/#{dsym_path}',
binary_path: 'fastlane/#{binary_path}',
platform: 'appletvos',
debug: true)
end").runner.execute(:test)
end

it "raises exception if no api access is given" do
allow(Fastlane::Actions::UploadSymbolsToCrashlyticsAction).to receive(:find_gsp_path).and_return(nil)

Expand Down