-
Notifications
You must be signed in to change notification settings - Fork 171
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
SES1628 - Add git commit details to version info #1459
SES1628 - Add git commit details to version info #1459
Conversation
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.
Nice! though, BuildConfigField
is perhaps more appropriate.
@@ -7,7 +7,7 @@ | |||
<string name="ban">مسدود</string> | |||
<string name="save">ذخیره</string> | |||
<string name="note_to_self">یادداشت به خود</string> | |||
<string name="version_s">نسخه</string> | |||
<string name="version_s">%s نسخه</string> |
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.
how did you spot this?
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.
Android wouldn't format the string with %s
substitutions, so I looked through the translations until I found one that was missing the substitution token - after adding it substitution was allowed. No idea how the code in dev
worked without it - but git history of this line says the last modifications was in 2022...
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.
Might just be a setting in Android Studio, or a feature of some version of Android Studio?
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.
Might just be a setting in Android Studio, or a feature of some version of Android Studio?
Ah, yeah - I did upgrade to Android Studio 2023.3.1 RC 2 the other day to play w/ the Gemini AI while it's in preview (i.e. free) - perhaps that picked it up while previous AS versions won't complain about it.
app/build.gradle
Outdated
} | ||
debug { | ||
isDefault true | ||
minifyEnabled false | ||
enableUnitTestCoverage true | ||
resValue("string", "git_hash", getGitHash()) |
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.
resources are really useful for things that have different values in different languages/configurations.
This is a constant, so it can be a buildConfigField
as a constant. Also then we can just declare it once.
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.
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.
LGTM, not sure about
-
Is this just supposed to be on emulators and/or debug build?
-
I'm not sure the formatting of
v1.17.15 (1705 - aef726)
is the most readable, I guess there's no designs for this.
|
Contributor checklist
Fixes #1234
syntaxDescription
Adds the first 6 chars of the current git commit hash used to build the app to the "Version: [foo]" details in the Settings activity.