dokka
dokka copied to clipboard
apply kotlin-dsl plugin
Part of #2700
apply kotlin-dsl plugin, and update code to use idiomatic Gradle API
This helps because the code in the plugin will more closely match the code used in *.gradle.kts files
My pleasure!
For reference the results of applying kotlin-dsl are specified here: https://docs.gradle.org/7.5.1/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin
One of the changes that isn't explicitly stated is that the Kotlin language level will be changed to 1.4, to match the compatibility defined here: https://docs.gradle.org/current/userguide/compatibility.html#kotlin
Looks like integration tests fail for Gradle 5.6, but I don't think we have to support it as KGP supports 6.7.1 onwards.
Caused by: java.lang.TypeNotPresentException: Type org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension not present
at org.gradle.api.reflect.TypeOf.captureTypeArgument(TypeOf.java:280)
at org.gradle.api.reflect.TypeOf.<init>(TypeOf.java:97)
at org.jetbrains.dokka.gradle.UtilsKt$kotlinOrNull$$inlined$findByType$1.<init>(TypeOfExtensions.kt:28)
at org.jetbrains.dokka.gradle.UtilsKt.getKotlinOrNull(utils.kt:59)
I've made an attempt to fix it in #2739, need to wait until it gets merged and rebased onto
An update on this: I like the change and the DSL, but we cannot merge it until after the 1.8.10 release, but it should hopefully be soon.
The reason is that kotlin-dsl doesn't seem to work with Gradle 5.6, but we use 5.6 for the stdlib integration test, and we cannot upgrade it there. We agreed to remove/update the test after 1.8.10 though, so it should unblock this PR.
The stdlib integration tests has been removed, so this PR has been unblocked (finally) :tada:
I've tested this branch locally with the latest master, all the tests pass, so I'm merging it