diff --git a/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb b/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb index bb2cc353a62..87a9b9267b7 100644 --- a/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb +++ b/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb @@ -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] @@ -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 @@ -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 diff --git a/fastlane/spec/actions_specs/upload_symbols_to_crashlytics_spec.rb b/fastlane/spec/actions_specs/upload_symbols_to_crashlytics_spec.rb index 91a7355dda2..32516ead824 100644 --- a/fastlane/spec/actions_specs/upload_symbols_to_crashlytics_spec.rb +++ b/fastlane/spec/actions_specs/upload_symbols_to_crashlytics_spec.rb @@ -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)