Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply kotlin-dsl plugin #2702

Merged
merged 7 commits into from Feb 21, 2023

Conversation

aSemy
Copy link
Contributor

@aSemy aSemy commented Oct 11, 2022

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

Copy link
Member

@IgnatBeresnev IgnatBeresnev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems innocent and useful enough, thanks!

I'll start some lengthy gradle integration tests just in case, the PR can be merged once they all pass

@aSemy
Copy link
Contributor Author

aSemy commented Oct 12, 2022

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

@IgnatBeresnev
Copy link
Member

IgnatBeresnev commented Nov 4, 2022

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
Copy link
Member

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.

…sl_plugin

# Conflicts:
#	runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/utils.kt
#	runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt
#	runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationJsonTest.kt
#	runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaConfigurationSerializableTest.kt
#	runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaTaskTest.kt
#	runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt
#	runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinDslDokkaTaskConfigurationTest.kt
@IgnatBeresnev
Copy link
Member

The stdlib integration tests has been removed, so this PR has been unblocked (finally) 🎉

I've tested this branch locally with the latest master, all the tests pass, so I'm merging it

@IgnatBeresnev IgnatBeresnev merged commit 0a09318 into Kotlin:master Feb 21, 2023
@Goooler Goooler mentioned this pull request Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
runner: Gradle plugin An issue/PR related to Dokka's Gradle plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants