diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 80f6fd73..f979603b 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -3,6 +3,7 @@ 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") @@ -62,8 +63,9 @@ android { versionCode = 63 versionName = "4.3.1" + val commitHashFile = layout.projectDirectory.file("commit-hash.txt") resValue("string", "app_version", "${defaultConfig.versionName}${versionNameSuffix ?: ""}") - resValue("string", "commit_hash", "git rev-parse --short HEAD".execute() ?: "") + resValue("string", "commit_hash", file(commitHashFile).readText()) resValue("bool", "is_prerelease", "false") // Reads local.properties @@ -182,7 +184,7 @@ dependencies { // For KSP -> Official Annotation Processors are Not Yet Supported for KSP ksp("dev.zacsweers.autoservice:auto-service-ksp:1.1.0") - implementation("com.google.guava:guava:32.1.3-android") + implementation("com.google.guava:guava:33.0.0-android") implementation("dev.zacsweers.autoservice:auto-service-ksp:1.1.0") // Media 3 (ExoPlayer) @@ -233,6 +235,21 @@ dependencies { implementation("com.github.Blatzar:NiceHttp:0.4.5") // 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) { archiveClassifier.set("sources") from(android.sourceSets.getByName("main").java.srcDirs) // Full Sources diff --git a/build.gradle.kts b/build.gradle.kts index d2959529..1066ffc5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,7 @@ buildscript { mavenCentral() } dependencies { - classpath("com.android.tools.build:gradle:8.2.1") + classpath("com.android.tools.build:gradle:8.2.2") 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.16" apply false + id("com.google.devtools.ksp") version "1.9.22-1.0.17" apply false } tasks.register("clean") { diff --git a/gradle.properties b/gradle.properties index 6a873a6a..8260a224 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,4 +20,5 @@ android.useAndroidX=true # Kotlin code style for this project: "official" or "obsolete": kotlin.code.style=official android.nonTransitiveRClass=false -android.nonFinalResIds=false \ No newline at end of file +android.nonFinalResIds=false +org.gradle.configuration-cache=true \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fc2d0f86..2a0af4b4 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.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists zipStoreBase=GRADLE_USER_HOME