diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 8917647f..d7a73440 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -3,7 +3,6 @@ import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.ByteArrayOutputStream import java.net.URL -import kotlin.io.outputStream plugins { id("com.android.application") @@ -63,9 +62,13 @@ android { versionCode = 63 versionName = "4.3.1" - val commitHashFile = layout.buildDirectory.file("commit-hash.txt") + // retrieve latest commit hash + val gitVersion = providers.exec { + commandLine("git", "rev-parse", "--short", "HEAD") + }.standardOutput.asText.get() + resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}") - resValue("string", "commit_hash", file(commitHashFile).readText()) + resValue("string", "commit_hash", gitVersion) resValue("bool", "is_prerelease", "false") // Reads local.properties @@ -233,22 +236,6 @@ dependencies { implementation("androidx.work:work-runtime:2.9.0") implementation("androidx.work:work-runtime-ktx:2.9.0") implementation("com.github.Blatzar:NiceHttp:0.4.11") // HTTP Lib - implementation("com.github.Blatzar:NiceHttp:0.4.11") // HTTP Lib -} - -tasks.register("retrieveCommitHash") { - // task needed because configurationCache does not support parallel git commands - group = "build" - description = "Retrieves the commit hash." - - doFirst { - commandLine("git", "rev-parse", "--short", "HEAD") - val commitOutput = layout.projectDirectory.file("commit-hash.txt") - standardOutput = commitOutput.asFile.outputStream() - } - - outputs.file(layout.projectDirectory.file("commit-hash.txt")) - mustRunAfter(tasks.assemble) } tasks.register("androidSourcesJar", Jar::class) { diff --git a/app/build/commit-hash.txt b/app/build/commit-hash.txt deleted file mode 100644 index f1002249..00000000 --- a/app/build/commit-hash.txt +++ /dev/null @@ -1 +0,0 @@ -2b7d102 \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 1066ffc5..d2959529 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:8.2.2") + classpath("com.android.tools.build:gradle:8.2.1") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.22") classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.9.10") @@ -22,7 +22,7 @@ allprojects { } plugins { - id("com.google.devtools.ksp") version "1.9.22-1.0.17" apply false + id("com.google.devtools.ksp") version "1.9.22-1.0.16" apply false } tasks.register("clean") { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2a0af4b4..fc2d0f86 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ #Fri Apr 30 17:11:15 CEST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME