diff --git a/assemble_docs.sh b/assemble_docs.sh index 8431b0637e..e0b5f7377c 100755 --- a/assemble_docs.sh +++ b/assemble_docs.sh @@ -5,4 +5,4 @@ set -e rm -rf docs/api # Build the docs. -./gradlew clean dokkaHtmlMultiModule +./gradlew clean dokkaGenerate diff --git a/build.gradle.kts b/build.gradle.kts index fb5b8e8835..c8e813bc7e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -7,8 +7,6 @@ import com.diffplug.gradle.spotless.SpotlessExtensionPredeclare import dev.drewhamilton.poko.gradle.PokoPluginExtension import kotlinx.validation.ApiValidationExtension import kotlinx.validation.ExperimentalBCVApi -import org.jetbrains.dokka.gradle.DokkaMultiModuleTask -import org.jetbrains.dokka.gradle.DokkaTaskPartial import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag import org.jetbrains.kotlin.gradle.dsl.JvmTarget @@ -36,7 +34,6 @@ buildscript { plugins { alias(libs.plugins.baselineProfile) apply false alias(libs.plugins.binaryCompatibility) - alias(libs.plugins.dokka) alias(libs.plugins.poko) apply false alias(libs.plugins.spotless) } @@ -52,10 +49,6 @@ extensions.configure { } } -tasks.withType().configureEach { - outputDirectory = layout.projectDirectory.dir("docs/api") -} - allprojects { repositories { google() @@ -76,38 +69,14 @@ allprojects { compilerOptions.jvmTarget = JvmTarget.JVM_1_8 } - tasks.withType().configureEach { - dokkaSourceSets.configureEach { - jdkVersion = 8 - failOnWarning = true - skipDeprecated = true - suppressInheritedMembers = true - - externalDocumentationLink( - url = "https://developer.android.com/reference/", - ) - externalDocumentationLink( - url = "https://kotlinlang.org/api/kotlinx.coroutines/", - ) - externalDocumentationLink( - url = "https://jetbrains.github.io/skiko/", - packageListUrl = "https://jetbrains.github.io/skiko/skiko/package-list", - ) - externalDocumentationLink( - url = "https://api.ktor.io/", - ) - externalDocumentationLink( - url = "https://kotlinlang.org/api/kotlinx-datetime/", - packageListUrl = "https://kotlinlang.org/api/kotlinx-datetime/kotlinx-datetime/package-list", - ) - externalDocumentationLink( - url = "https://square.github.io/okio/3.x/okio/", - packageListUrl = "https://square.github.io/okio/3.x/okio/okio/package-list", - ) - externalDocumentationLink( - url = "https://square.github.io/okhttp/5.x/okhttp/okhttp3/", - packageListUrl = "https://square.github.io/okhttp/5.x/package-list", - ) + dependencies { + modules { + module("org.jetbrains.kotlin:kotlin-stdlib-jdk7") { + replacedBy("org.jetbrains.kotlin:kotlin-stdlib") + } + module("org.jetbrains.kotlin:kotlin-stdlib-jdk8") { + replacedBy("org.jetbrains.kotlin:kotlin-stdlib") + } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 19972cf740..8f7fbcfb8a 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -8,10 +8,12 @@ plugins { repositories { google() mavenCentral() + gradlePluginPortal() } dependencies { implementation(libs.gradlePlugin.android) + implementation(libs.gradlePlugin.dokka) implementation(libs.gradlePlugin.jetbrainsCompose) implementation(libs.gradlePlugin.composeCompiler) implementation(libs.gradlePlugin.kotlin) diff --git a/buildSrc/src/main/kotlin/coil3/projects.kt b/buildSrc/src/main/kotlin/coil3/projects.kt index 484da77bca..bf8e36a4af 100644 --- a/buildSrc/src/main/kotlin/coil3/projects.kt +++ b/buildSrc/src/main/kotlin/coil3/projects.kt @@ -35,7 +35,7 @@ fun Project.androidLibrary( apply(plugin = "com.vanniktech.maven.publish.base") setupPublishing { val platform = if (project.plugins.hasPlugin("org.jetbrains.kotlin.multiplatform")) { - KotlinMultiplatform(Dokka("dokkaHtml")) + KotlinMultiplatform(Dokka("dokkaGenerate")) } else { AndroidSingleVariantLibrary() } diff --git a/coil-core/build.gradle.kts b/coil-core/build.gradle.kts index b0c6397ae1..366ecf899e 100644 --- a/coil-core/build.gradle.kts +++ b/coil-core/build.gradle.kts @@ -7,6 +7,7 @@ plugins { id("org.jetbrains.kotlinx.atomicfu") id("dev.drewhamilton.poko") id("androidx.baselineprofile") + id("org.jetbrains.dokka") } addAllMultiplatformTargets(libs.versions.skiko) diff --git a/gradle.properties b/gradle.properties index 64480d48e8..d6a4c9474f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -org.gradle.jvmargs=-Xmx8g -Xms2g -XX:MaxMetaspaceSize=2g -XX:+UseParallelGC -Dfile.encoding=UTF-8 +org.gradle.jvmargs=-Xmx16g -Xms2g -XX:MaxMetaspaceSize=2g -XX:+UseParallelGC -Dfile.encoding=UTF-8 # Android android.experimental.enableScreenshotTest=true @@ -18,6 +18,8 @@ org.jetbrains.compose.experimental.jscanvas.enabled=true org.jetbrains.compose.experimental.macos.enabled=true org.jetbrains.compose.experimental.uikit.enabled=true org.jetbrains.compose.experimental.wasm.enabled=true +org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled +org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true # Config minSdk=21 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d64d7f1d3d..3334da8e80 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,6 @@ skiko = "0.8.18" [plugins] baselineProfile = { id = "androidx.baselineprofile", version.ref = "androidx-benchmark" } binaryCompatibility = "org.jetbrains.kotlinx.binary-compatibility-validator:0.16.3" -dokka = "org.jetbrains.dokka:1.9.20" poko = "dev.drewhamilton.poko:0.18.1" screenshot = "com.android.compose.screenshot:0.0.1-alpha08" spotless = "com.diffplug.spotless:6.25.0" @@ -27,8 +26,9 @@ spotless = "com.diffplug.spotless:6.25.0" [libraries] gradlePlugin-android = "com.android.tools.build:gradle:8.7.3" gradlePlugin-atomicFu = "org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.26.1" -gradlePlugin-jetbrainsCompose = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jetbrains-compose" } gradlePlugin-composeCompiler = { module = "org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin", version.ref = "kotlin" } +gradlePlugin-dokka = "org.jetbrains.dokka:dokka-gradle-plugin:2.0.0" +gradlePlugin-jetbrainsCompose = { module = "org.jetbrains.compose:compose-gradle-plugin", version.ref = "jetbrains-compose" } gradlePlugin-kotlin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } gradlePlugin-mavenPublish = "com.vanniktech:gradle-maven-publish-plugin:0.30.0" gradlePlugin-paparazzi = { module = "app.cash.paparazzi:paparazzi-gradle-plugin", version.ref = "paparazzi" }