Skip to content

Commit

Permalink
Merge pull request #15 from chenxiaolong/git-commit
Browse files Browse the repository at this point in the history
SettingsActivity: Link to the specific commit for the build
  • Loading branch information
chenxiaolong committed May 22, 2022
2 parents df17158 + a4223c9 commit f735197
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ android {
versionName = gitVersionName

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

buildConfigField("String", "GIT_COMMIT", "\"${gitVersionTriple.third.name}\"")
}
signingConfigs {
create("release") {
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/com/chiller3/bcr/SettingsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ class SettingsActivity : AppCompatActivity() {
return true
}
prefVersion -> {
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(PROJECT_URL)))
val url = PROJECT_BASE_URL + BuildConfig.GIT_COMMIT
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(url)))
return true
}
}
Expand Down Expand Up @@ -170,7 +171,7 @@ class SettingsActivity : AppCompatActivity() {
}

companion object {
private const val PROJECT_URL = "https://github.com/chenxiaolong/BCR"
private const val PROJECT_BASE_URL = "https://github.com/chenxiaolong/BCR/tree/"
}
}
}

0 comments on commit f735197

Please sign in to comment.