diff --git a/android/build.gradle.kts b/android/build.gradle.kts index 6ee3a36..3bfa545 100644 --- a/android/build.gradle.kts +++ b/android/build.gradle.kts @@ -1,5 +1,6 @@ import com.vanniktech.maven.publish.AndroidSingleVariantLibrary -import com.vanniktech.maven.publish.SonatypeHost +import com.vanniktech.maven.publish.JavadocJar +import com.vanniktech.maven.publish.SourcesJar import org.jetbrains.kotlin.gradle.dsl.JvmTarget // The Dokka Gradle plugin puts Dokka's engine, and with it Jackson, on this build script's @@ -15,8 +16,10 @@ buildscript { plugins { id("com.android.library") - kotlin("android") - kotlin("kapt") + // AGP 9 has Kotlin support built in, so org.jetbrains.kotlin.android must not be applied. + // legacy-kapt replaces org.jetbrains.kotlin.kapt, which is unsupported with built-in Kotlin; + // it is what runs the data binding annotation processor. + id("com.android.legacy-kapt") kotlin("plugin.serialization") version "2.4.20" alias(libs.plugins.dokka) alias(libs.plugins.dokka.javadoc) @@ -103,7 +106,6 @@ android { buildTypes { getByName("debug") { enableAndroidTestCoverage = true - isTestCoverageEnabled = true // For backward compatibility } release { isMinifyEnabled = true @@ -179,7 +181,7 @@ dokka { } } -val dokkaJavadocJar by tasks.registering(Jar::class) { +val dokkaJavadocJar = tasks.register("dokkaJavadocJar") { group = "documentation" description = "Packages the Dokka Javadoc output into the -javadoc jar published to Maven Central." from(tasks.named("dokkaGeneratePublicationJavadoc")) @@ -187,7 +189,7 @@ val dokkaJavadocJar by tasks.registering(Jar::class) { } mavenPublishing { - publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) + publishToMavenCentral() // AGP's own withJavadocJar() runs a bundled Dokka 1.4.32 engine on a detached // configuration that neither the dependency report nor the floors above can reach (old @@ -196,8 +198,8 @@ mavenPublishing { configure( AndroidSingleVariantLibrary( variant = "release", - sourcesJar = true, - publishJavadocJar = false, + sourcesJar = SourcesJar.Sources(), + javadocJar = JavadocJar.None(), ) ) diff --git a/build.gradle.kts b/build.gradle.kts index d4a2609..6b69936 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -29,6 +29,6 @@ buildscript { plugins { alias(libs.plugins.android.application) apply false - alias(libs.plugins.kotlin.android) apply false alias(libs.plugins.android.library) apply false + alias(libs.plugins.android.legacy.kapt) apply false } diff --git a/gradle.properties b/gradle.properties index cc6a08e..132244e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -21,6 +21,3 @@ kotlin.code.style=official # resources declared in the library itself and none from the library's dependencies, # thereby reducing the size of the R class for that library android.nonTransitiveRClass=true - -# Enable build config generation -android.defaults.buildfeatures.buildconfig=true \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7744cf5..4004439 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -81,5 +81,6 @@ androidx-databinding-common = { group = "androidx.databinding", name = "databind android-application = { id = "com.android.application", version.ref = "agp" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } android-library = { id = "com.android.library", version.ref = "agp" } +android-legacy-kapt = { id = "com.android.legacy-kapt", version.ref = "agp" } dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" } dokka-javadoc = { id = "org.jetbrains.dokka-javadoc", version.ref = "dokka" }