Skip to content
This repository has been archived by the owner on Feb 2, 2021. It is now read-only.

Commit

Permalink
Show detailed version info in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
divadsn committed Feb 1, 2019
1 parent 8f04b4e commit 764618f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,18 @@ android {
targetSdkVersion 28
applicationId "de.codebucket.mkkm"

// These values are not intended to be shared public in repo!
ext.githubToken = localProps.getProperty('githubToken') ?: '"' + System.getenv("GITHUB_TOKEN") + '"'
ext.encryptionKey = localProps.getProperty('encryptionKey') ?: '"' + System.getenv("ENCRYPTION_KEY") + '"'

buildConfigField "String", "GITHUB_TOKEN", ext.githubToken
buildConfigField "String", "GIT_VERSION", "\"${getGitVersion()}\""

ext.encryptionKey = localProps.getProperty('encryptionKey') ?: '"' + System.getenv("ENCRYPTION_KEY") + '"'
buildConfigField "String", "ENCRYPTION_KEY", ext.encryptionKey

// Internal build info values
buildConfigField "String", "HOSTNAME", '"' + System.getenv("DRONE_REMOTE_URL") + '"'
buildConfigField "String", "CI_VERSION", '"' + System.getenv("DRONE_SYSTEM_VERSION") + '"'

if (System.getenv("TRAVIS") == "true") {
versionCode = Integer.valueOf(System.getenv("TRAVIS_BUILD_NUMBER"))
versionName = System.getenv("MAJOR_MINOR") + "." + System.getenv("TRAVIS_BUILD_NUMBER")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public boolean onPreferenceClick(Preference preference) {
});

Preference version = findPreference("version");
version.setSummary(getString(R.string.pref_version_description, BuildConfig.VERSION_NAME, BuildConfig.BUILD_TYPE, BuildConfig.GIT_VERSION));
version.setSummary(getString(R.string.pref_version_description, BuildConfig.VERSION_NAME, BuildConfig.BUILD_TYPE, BuildConfig.GIT_VERSION, BuildConfig.HOSTNAME));
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-pl/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<string name="pref_about_title">Licencje open-source</string>
<string name="pref_about_description">Poznaj współtwórców oraz użyte biblioteki</string>
<string name="pref_version_title">Aplikacja mobileKKM</string>
<string name="pref_version_description">wersja %s-%s.%s</string>
<string name="pref_version_description">wersja %s-%s.%s\n%s</string>
<string name="pref_restart">Zrestartuj aplikację</string>

<!-- Expiration values -->
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<string name="pref_about_title">Open-source licenses</string>
<string name="pref_about_description">Get to know the contributors and libraries used</string>
<string name="pref_version_title">mobileKKM app</string>
<string name="pref_version_description">version %s-%s.%s</string>
<string name="pref_version_description">version %s-%s.%s\n%s</string>
<string name="pref_restart">Restart app</string>

<!-- Expiration values -->
Expand Down
2 changes: 1 addition & 1 deletion build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export TRAVIS=true
export TRAVIS_BUILD_NUMBER=$1
export TRAVIS_EVENT_TYPE=push
export MAJOR_MINOR=1.1.0
export HOSTNAME=build.codebucket.de
export DRONE_MACHINE=localhost

bash ./gradlew app:assembleRelease
status=$?
Expand Down

0 comments on commit 764618f

Please sign in to comment.