From 085f805a8ad17830f8fe8351982cf6588555c1ba Mon Sep 17 00:00:00 2001 From: Colin White Date: Tue, 15 Oct 2024 12:46:01 -0700 Subject: [PATCH 1/3] Update to Dokka 2.0.0-Beta. --- assemble_docs.sh | 2 +- build.gradle.kts | 34 ---------------------- buildSrc/build.gradle.kts | 2 ++ buildSrc/src/main/kotlin/coil3/projects.kt | 4 +-- coil-core/build.gradle.kts | 1 + gradle.properties | 4 ++- gradle/libs.versions.toml | 4 +-- 7 files changed, 11 insertions(+), 40 deletions(-) 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 a514c3b60b..b7f2cefbb1 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,33 +69,6 @@ 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://square.github.io/okio/3.x/okio/", - packageListUrl = "https://square.github.io/okio/3.x/okio/okio/package-list", - ) - externalDocumentationLink( - url = "https://jetbrains.github.io/skiko/", - packageListUrl = "https://jetbrains.github.io/skiko/skiko/package-list", - ) - externalDocumentationLink( - url = "https://api.ktor.io/", - ) - } - } - dependencies { modules { module("org.jetbrains.kotlin:kotlin-stdlib-jdk7") { 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..e432740ef4 100644 --- a/buildSrc/src/main/kotlin/coil3/projects.kt +++ b/buildSrc/src/main/kotlin/coil3/projects.kt @@ -30,12 +30,12 @@ fun Project.androidLibrary( sourceSets["main"].resources { srcDirs("src/commonMain/resources", "src/jvmCommonMain/resources") } - if (project.name in publicModules) { + if (false && project.name in publicModules) { apply(plugin = "org.jetbrains.dokka") 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 a3c4e13e01..9c904205b0 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 @@ -20,6 +20,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 9b93ed86a4..d93237104b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,6 @@ skiko = "0.8.4" [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.17.1" screenshot = "com.android.compose.screenshot:0.0.1-alpha07" 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.1" gradlePlugin-atomicFu = "org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.25.0" -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-Beta" +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" } From b92a0941cf8c844ae6f006ed845429b1ddea5fb1 Mon Sep 17 00:00:00 2001 From: Colin White Date: Mon, 16 Dec 2024 12:40:10 -0500 Subject: [PATCH 2/3] Update to 2.0.0. --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index d571bf5661..3334da8e80 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -27,7 +27,7 @@ spotless = "com.diffplug.spotless:6.25.0" gradlePlugin-android = "com.android.tools.build:gradle:8.7.3" gradlePlugin-atomicFu = "org.jetbrains.kotlinx:atomicfu-gradle-plugin:0.26.1" 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-Beta" +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" From 5b96f4640373a714893310dacaa22353f582f20b Mon Sep 17 00:00:00 2001 From: Colin White Date: Mon, 16 Dec 2024 13:04:18 -0500 Subject: [PATCH 3/3] Uncomment. --- buildSrc/src/main/kotlin/coil3/projects.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/coil3/projects.kt b/buildSrc/src/main/kotlin/coil3/projects.kt index e432740ef4..bf8e36a4af 100644 --- a/buildSrc/src/main/kotlin/coil3/projects.kt +++ b/buildSrc/src/main/kotlin/coil3/projects.kt @@ -30,7 +30,7 @@ fun Project.androidLibrary( sourceSets["main"].resources { srcDirs("src/commonMain/resources", "src/jvmCommonMain/resources") } - if (false && project.name in publicModules) { + if (project.name in publicModules) { apply(plugin = "org.jetbrains.dokka") apply(plugin = "com.vanniktech.maven.publish.base") setupPublishing {