Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a3d5d43

Browse files
authoredAug 13, 2024··
Merge Dokkatoo into Dokka Gradle Plugin (#3695)
Initial Dokkatoo import - merge DGP-classic into dokka-gradle-plugin - add flag to toggle between DPG-classic and Dokkatoo - Update Dokkatoo code to be Java-8 compatible - update dokkatoo package name - stop using `org.jetbrains.dokka.gradle.utils.sourceLink_` - weird class-not-found compilation issue - update TaskPathCollector workaround - fix LogHtmlPublicationLinkTask - use Http instead of Https connection - Specify language/api as Kotlin 1.4 for dokka-gradle-plugin (to be compatible with Gradle 7) - update api dump - update formatting, add copyright header - remove duplicated 'Isolation' from WorkerIsolation subtypes, & fix test - renaming 'Dokkatoo' to 'Dokka'... - fix process isolation worker jvm args - add 'min supported Gradle' warning - lazily fetch DokkaGradlePluginMode from `project.extra.properties` - fixing KotlinNativeDistributionAccessor... - fix DGP group/version - add copyright header - Change BCV to official BCV - fix `toLowerCase()` deprecation - remove `dokka-gradle-plugin` from `libs.versions.toml` (it's no longer used) - remove duplicated plugin website/vcsUrl, move tags into specific Dokka plugin - exclude Gradle's embedded-dependencies from DGP - remove extraneous leftover groups
1 parent 570d958 commit a3d5d43

File tree

160 files changed

+10473
-477
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

160 files changed

+10473
-477
lines changed
 

‎build-logic/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ kotlin {
1313
}
1414

1515
dependencies {
16-
implementation(libs.gradlePlugin.dokka)
1716
implementation(libs.gradlePlugin.kotlin)
1817
implementation(libs.gradlePlugin.shadow)
1918
implementation("org.gradle.kotlin:gradle-kotlin-dsl-plugins:$expectedKotlinDslPluginsVersion")

‎build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts

+17-16
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,35 @@
22
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
33
*/
44

5-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
5+
import dokkabuild.utils.excludeGradleEmbeddedDependencies
6+
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
67

78
plugins {
89
id("org.gradle.kotlin.kotlin-dsl")
910
id("dokkabuild.java")
10-
kotlin("jvm")
1111
id("dokkabuild.publish-gradle-plugin")
1212
}
1313

14-
// org.gradle.kotlin.kotlin-dsl sets languageVersion and apiVersion to 1.8 by default starting from Gradle 8.
15-
// As we need to be compatible with previous Gradle versions, we need to set it back to 1.4.
16-
// Note: we should do it directly on tasks and not via top-level `kotlin.compilerOptions`
17-
// because `kotlin-dsl plugin` declares them on task level, and so top-level config is overridden
18-
tasks.withType<KotlinCompile>().configureEach {
14+
kotlin {
1915
compilerOptions {
20-
languageVersion = dokkaBuild.kotlinLanguageLevel
21-
apiVersion = dokkaBuild.kotlinLanguageLevel
16+
// Must use Kotlin 1.4 to support Gradle 7
17+
languageVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_4
18+
apiVersion = @Suppress("DEPRECATION") KotlinVersion.KOTLIN_1_4
19+
}
20+
}
2221

23-
freeCompilerArgs.addAll(
24-
// need 1.4 support, otherwise there might be problems
25-
// with Gradle 6.x (it's bundling Kotlin 1.4)
26-
"-Xsuppress-version-warnings",
27-
"-Xjsr305=strict",
28-
"-Xskip-metadata-version-check",
29-
)
22+
tasks.compileKotlin {
23+
compilerOptions {
24+
// `kotlin-dsl` plugin overrides the versions at the task level,
25+
// which takes priority over the `kotlin` project extension.
26+
// So, fix it by manually setting the LV per-task.
27+
languageVersion.set(kotlin.compilerOptions.languageVersion)
28+
apiVersion.set(kotlin.compilerOptions.apiVersion)
3029
}
3130
}
3231

3332
tasks.validatePlugins {
3433
enableStricterValidation = true
3534
}
35+
36+
excludeGradleEmbeddedDependencies(sourceSets.main)

0 commit comments

Comments
 (0)
Please sign in to comment.