-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
Allow manually specifying android mapping-uuid #80
Closed
mateuszkwiecinski
wants to merge
1
commit into
getsentry:master
from
mateuszkwiecinski:add_proguard_mapping_uuid
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,17 +9,24 @@ def self.run(params) | |
mapping_path = params[:mapping_path] | ||
android_manifest_path = params[:android_manifest_path] | ||
|
||
has_manifest = !android_manifest_path.nil? && File.file?(android_manifest_path.to_s) | ||
|
||
# Verify files | ||
UI.user_error!("Mapping file does not exist at path: #{mapping_path}") unless File.exist? mapping_path | ||
UI.user_error!("AndroidManifest.xml file does not exist at path: #{android_manifest_path}") unless File.exist? android_manifest_path | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIU This validation was never invoked, as the framework checks its valie using ConfigItem's |
||
|
||
command = [ | ||
"sentry-cli", | ||
"upload-proguard", | ||
"--android-manifest", | ||
android_manifest_path, | ||
mapping_path | ||
] | ||
# Create command | ||
command = %w[sentry-cli upload-proguard] | ||
command += ["--android-manifest", android_manifest_path] if has_manifest | ||
command += ["--app-id", params[:app_id]] unless params[:app_id].nil? | ||
command += ["--no-reprocessing"] if !!params[:no_reprocessing] | ||
command += ["--no-upload"] if !!params[:no_upload] | ||
command += ["--platform", params[:platform]] unless params[:platform].nil? | ||
command += ["--require-one"] if !!params[:require_one] | ||
command += ["--uuid", params[:uuid]] unless params[:uuid].nil? | ||
command += ["--version", params[:version]] unless params[:version].nil? | ||
command += ["--version-code", params[:version_code]] unless params[:version_code].nil? | ||
|
||
command += [mapping_path] | ||
|
||
Helper::SentryHelper.call_sentry_cli(command) | ||
UI.success("Successfully uploaded mapping file!") | ||
|
@@ -43,19 +50,58 @@ def self.details | |
def self.available_options | ||
Helper::SentryConfig.common_api_config_items + [ | ||
FastlaneCore::ConfigItem.new(key: :mapping_path, | ||
env_name: "ANDROID_MAPPING_PATH", | ||
description: "Path to your proguard mapping.txt file", | ||
optional: false, | ||
verify_block: proc do |value| | ||
UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value) | ||
end), | ||
env_name: "ANDROID_MAPPING_PATH", | ||
description: "Path to your proguard mapping.txt file", | ||
optional: false, | ||
verify_block: proc do |value| | ||
UI.user_error! "Could not find your mapping file at path '#{value}'" unless File.exist?(value) | ||
end), | ||
FastlaneCore::ConfigItem.new(key: :android_manifest_path, | ||
env_name: "ANDROID_MANIFEST_PATH", | ||
description: "Path to your merged AndroidManifest file. This is usually found under `app/build/intermediates/manifests/full`", | ||
optional: false, | ||
verify_block: proc do |value| | ||
UI.user_error! "Could not find your merged AndroidManifest file at path '#{value}'" unless File.exist?(value) | ||
end) | ||
env_name: "ANDROID_MANIFEST_PATH", | ||
description: "Path to your merged AndroidManifest file. This is usually found under `app/build/intermediates/manifests/full`", | ||
optional: true, | ||
verify_block: proc do |value| | ||
UI.user_error! "Could not find your merged AndroidManifest file at path '#{value}'" unless File.exist?(value) | ||
end), | ||
FastlaneCore::ConfigItem.new(key: :app_id, | ||
env_name: "APP_ID", | ||
description: "Associate the mapping files with an application ID", | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :no_reprocessing, | ||
env_name: "NO_REPROCESSING", | ||
description: "Do not trigger reprocessing after upload", | ||
is_string: false, | ||
default_value: false, | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :no_upload, | ||
env_name: "NO_UPLOAD", | ||
description: "Disable the actual upload", | ||
is_string: false, | ||
default_value: false, | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :platform, | ||
env_name: "PLATFORM", | ||
description: "Optionally defines the platform for the app association. [defaults to 'android']", | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :require_one, | ||
env_name: "REQUIRE_ONE", | ||
description: "Requires at least one file to upload or the command will error", | ||
is_string: false, | ||
default_value: false, | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :uuid, | ||
env_name: "UUID", | ||
description: "Explicitly override the UUID of the mapping file with another one", | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :version, | ||
env_name: "VERSION_NAME", | ||
description: "Optionally associate the mapping files with a human readable version", | ||
optional: true), | ||
FastlaneCore::ConfigItem.new(key: :version_code, | ||
env_name: "VERSION_CODE", | ||
description: "Optionally associate the mapping files with a version code", | ||
is_string: false, | ||
optional: true) | ||
] | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using
File.file?
as I understood we don't support passing a directory