fastlane/lib/fastlane/actions/download_dsyms.rb in fastlane_hotfix-2.165.1 vs fastlane/lib/fastlane/actions/download_dsyms.rb in fastlane_hotfix-2.187.0
- old
+ new
@@ -37,17 +37,12 @@
platform = Spaceship::ConnectAPI::Platform.map(itc_platform)
# Set version if it is latest
if version == 'latest'
# Try to grab the edit version first, else fallback to live version
- UI.message("Looking for latest version...")
- latest_version = app.get_edit_app_store_version(platform: platform) || app.get_live_app_store_version(platform: platform)
-
- UI.user_error!("Could not find latest version for your app, please try setting a specific version") if latest_version.nil?
-
- latest_build = get_latest_build!(app_id: app.id, version: latest_version.version_string, platform: platform)
-
+ UI.message("Looking for latest build...")
+ latest_build = get_latest_build!(app_id: app.id, platform: platform)
version = latest_build.app_version
build_number = latest_build.version
elsif version == 'live'
UI.message("Looking for live version...")
live_version = app.get_live_app_store_version(platform: platform)
@@ -57,15 +52,10 @@
# No need to search for candidates, because released App Store version should only have one build
version = live_version.version_string
build_number = live_version.build.version
end
- # Remove leading zeros from version string (eg. 1.02 -> 1.2)
- if version
- version = version.split(".").map(&:to_i).join(".")
- end
-
# Make sure output_directory has a slash on the end
if output_directory && !output_directory.end_with?('/')
output_directory += '/'
end
@@ -159,18 +149,18 @@
UI.message("No dSYM URL for #{build_number} (#{train})")
end
end
# rubocop:enable Metrics/PerceivedComplexity
- def self.get_latest_build!(app_id: nil, version: nil, platform: nil)
+ def self.get_latest_build!(app_id: nil, platform: nil)
filter = { app: app_id }
- filter["preReleaseVersion.version"] = version
filter["preReleaseVersion.platform"] = platform
latest_build = Spaceship::ConnectAPI.get_builds(filter: filter, sort: "-uploadedDate", includes: "preReleaseVersion").first
if latest_build.nil?
- UI.user_error!("Could not find latest build for version #{version}")
+ UI.user_error!("Could not find any build for platform #{platform}") if platform
+ UI.user_error!("Could not find any build")
end
return latest_build
end
@@ -261,11 +251,11 @@
FastlaneCore::ConfigItem.new(key: :team_id,
short_option: "-k",
env_name: "DOWNLOAD_DSYMS_TEAM_ID",
description: "The ID of your App Store Connect team if you're in multiple teams",
optional: true,
- is_string: false, # as we also allow integers, which we convert to strings anyway
+ skip_type_validation: true, # as we also allow integers, which we convert to strings anyway
code_gen_sensitive: true,
default_value: CredentialsManager::AppfileConfig.try_fetch_value(:itc_team_id),
default_value_dynamic: true,
verify_block: proc do |value|
ENV["FASTLANE_ITC_TEAM_ID"] = value.to_s
@@ -283,11 +273,10 @@
end),
FastlaneCore::ConfigItem.new(key: :platform,
short_option: "-p",
env_name: "DOWNLOAD_DSYMS_PLATFORM",
description: "The app platform for dSYMs you wish to download (ios, appletvos)",
- optional: true,
default_value: :ios),
FastlaneCore::ConfigItem.new(key: :version,
short_option: "-v",
env_name: "DOWNLOAD_DSYMS_VERSION",
description: "The app version for dSYMs you wish to download, pass in 'latest' to download only the latest build's dSYMs or 'live' to download only the live version dSYMs",
@@ -295,21 +284,20 @@
FastlaneCore::ConfigItem.new(key: :build_number,
short_option: "-b",
env_name: "DOWNLOAD_DSYMS_BUILD_NUMBER",
description: "The app build_number for dSYMs you wish to download",
optional: true,
- is_string: false),
+ skip_type_validation: true), # as we also allow integers, which we convert to strings anyway
FastlaneCore::ConfigItem.new(key: :min_version,
short_option: "-m",
env_name: "DOWNLOAD_DSYMS_MIN_VERSION",
description: "The minimum app version for dSYMs you wish to download",
optional: true),
FastlaneCore::ConfigItem.new(key: :after_uploaded_date,
short_option: "-d",
env_name: "DOWNLOAD_DSYMS_AFTER_UPLOADED_DATE",
description: "The uploaded date after which you wish to download dSYMs",
- optional: true,
- is_string: true),
+ optional: true),
FastlaneCore::ConfigItem.new(key: :output_directory,
short_option: "-s",
env_name: "DOWNLOAD_DSYMS_OUTPUT_DIRECTORY",
description: "Where to save the download dSYMs, defaults to the current path",
optional: true),