Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -103,7 +106,6 @@ android {
buildTypes {
getByName("debug") {
enableAndroidTestCoverage = true
isTestCoverageEnabled = true // For backward compatibility
}
release {
isMinifyEnabled = true
Expand Down Expand Up @@ -179,15 +181,15 @@ dokka {
}
}

val dokkaJavadocJar by tasks.registering(Jar::class) {
val dokkaJavadocJar = tasks.register<Jar>("dokkaJavadocJar") {
group = "documentation"
description = "Packages the Dokka Javadoc output into the -javadoc jar published to Maven Central."
from(tasks.named("dokkaGeneratePublicationJavadoc"))
archiveClassifier.set("javadoc")
}

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
Expand All @@ -196,8 +198,8 @@ mavenPublishing {
configure(
AndroidSingleVariantLibrary(
variant = "release",
sourcesJar = true,
publishJavadocJar = false,
sourcesJar = SourcesJar.Sources(),
javadocJar = JavadocJar.None(),
)
)

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Loading