Skip to content
Snippets Groups Projects
Verified Commit 6fabadd6 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Fixes #81

parent 0ed34d2a
Branches
Tags
No related merge requests found
......@@ -58,6 +58,7 @@ android {
versionName = cmd("git", "describe", "--always", "--tags", "HEAD") ?: "1.0.0"
buildConfigField("String", "GIT_HEAD", "\"${cmd("git", "rev-parse", "HEAD") ?: ""}\"")
buildConfigField("String", "FANCY_VERSION_NAME", "\"${fancyVersionName() ?: ""}\"")
buildConfigField("long", "GIT_COMMIT_DATE", "${cmd("git", "show", "-s", "--format=%ct") ?: 0}L")
signingConfig = signingConfigs.findByName("default")
......
......@@ -340,7 +340,7 @@ class QuasselService : DaggerLifecycleService(),
)
clientData = ClientData(
identifier = "${resources.getString(R.string.app_name)} ${BuildConfig.VERSION_NAME}",
identifier = "${resources.getString(R.string.app_name)} ${BuildConfig.FANCY_VERSION_NAME}",
buildDate = Instant.ofEpochSecond(BuildConfig.GIT_COMMIT_DATE),
clientFeatures = QuasselFeatures.all(),
protocolFeatures = Protocol_Features.of(
......
import org.gradle.api.Project
fun Project.fancyVersionName(): String? {
val commit = cmd("git", "rev-parse", "HEAD")
val name = cmd("git", "describe", "--always", "--tags", "HEAD")
return if (commit != null && name != null) "<a href=\\\"https://git.kuschku.de/justJanne/QuasselDroid-ng/commit/$commit\\\">$name</a>"
else name
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment