dokka icon indicating copy to clipboard operation
dokka copied to clipboard

apply kotlin-dsl plugin

Open aSemy opened this issue 3 years ago • 1 comments
trafficstars

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

aSemy avatar Oct 11 '22 17:10 aSemy

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

aSemy avatar Oct 12 '22 20:10 aSemy

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

IgnatBeresnev avatar Nov 04 '22 21:11 IgnatBeresnev

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.

IgnatBeresnev avatar Jan 29 '23 13:01 IgnatBeresnev

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

IgnatBeresnev avatar Feb 21 '23 16:02 IgnatBeresnev