-
Notifications
You must be signed in to change notification settings - Fork 430
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
Merge Dokkatoo into Dokka Gradle Plugin #3695
Conversation
- delete old Dokkatoo dir - Add up-to-date Dokkatoo Tests pass. Still need to rename Dokkatoo->Dokka, update formatting, change package, plugin ID, disable non-HTML, update integration tests, add copyright header.
- convert dokka-subprojects to be an included build (otherwise DGP can't depend on dokka-core) - rename dokka-core to match the artifact ID (easier to understand dependencies and error messages) - merge DGP-classic into dokka-gradle-plugin - add flag to toggle between DPG-classic and Dokkatoo - Update Dokkatoo code to be Java-8 compatible
Gradle TestKit stores logs in memory and this makes the tests slower gradle/gradle#23965
- tidy up implementation - use build service to avoid `subprojects {}` (prepare for Project Isolation) gradle/gradle#22335
avoid issues with TestKit buffering logs in memory gradle/gradle#23965
- stop using `org.jetbrains.dokka.gradle.utils.sourceLink_` - weird class-not-found compilation issue - fixing build config...
use Http instead of Https connection
…patible with Gradle 7)
Update enable/disable Dokkatoo flag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine from my side!
I've added some comments, but they are mostly out of curiosity
about some Gradle usages.
I have no objections to merge it in current state and resolve anything else later
build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts
Outdated
Show resolved
Hide resolved
build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts
Outdated
Show resolved
Hide resolved
build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts
Outdated
Show resolved
Hide resolved
build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts
Outdated
Show resolved
Hide resolved
dokka-runners/dokka-gradle-plugin/src/main/kotlin/internal/ExperimentalFlags.kt
Show resolved
Hide resolved
# Conflicts: # dokka-integration-tests/gradle/src/testTemplateProjectTasksExecutionStress/kotlin/SequentialTasksExecutionStressTest.kt # gradle/libs.versions.toml
* Code taken from the Kotlin Gradle plugin: | ||
* https://github.com/JetBrains/kotlin/blob/70e15b281cb43379068facb82b8e4bcb897a3c4f/buildSrc/src/main/kotlin/GradleCommon.kt#L72 | ||
*/ | ||
fun Configuration.excludeGradleCommonDependencies() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see it in new configuration—please apply the same logic in new build script
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build config has been reworked so that the dependencies aren't added, so this exclusion does nothing.
If you run ./gradlew :dokka-gradle-plugin:publishDokkaPluginMarkerMavenPublicationToDevMavenRepo
and check dokka-runners/dokka-gradle-plugin/build/dev-maven-repo/org/jetbrains/dokka/dokka-gradle-plugin/2.0.20-SNAPSHOT/dokka-gradle-plugin-2.0.20-SNAPSHOT.pom
, then there's no conflicting dependencies.
We should make a test for this though... I've created a task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
serialization brings stdlib as a transitive dependency, that is why we need this code block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried hard to try and discover what the issue is, but I wasn't able to discover what could go wrong. Whenever Dokka was added as a buildSrc dependency, the kotlin-stdlib and other dependencies were correctly constrained to the embedded Gradle version.
When this exclusions config was added in #2570, at the time DGP used kotlin("jvm")
to build the project. This is probably what caused the issue, and the exclusions helped with that. (KGP is also built with kotlin("jvm")
.) DGP no longer uses kotlin("jvm")
, so I don't believe it's necessary. However, out of an abundance of caution, I've added the exclusions.
dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/AndroidAdapter.kt
Show resolved
Hide resolved
dokka-runners/dokka-gradle-plugin/src/main/kotlin/internal/ExperimentalFlags.kt
Show resolved
Hide resolved
dokka-runners/dokka-gradle-plugin/src/main/kotlin/internal/ExperimentalFlags.kt
Show resolved
Hide resolved
dokka-runners/dokka-gradle-plugin/src/testFixtures/kotlin/GradleTestKitUtils.kt
Outdated
Show resolved
Hide resolved
dokka-runners/dokka-gradle-plugin/src/testFixtures/kotlin/GradleTestKitUtils.kt
Outdated
Show resolved
Hide resolved
…the same, then jvmTarget is redundant
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just some small minor remarks
build-logic/src/main/kotlin/dokkabuild.gradle-plugin.gradle.kts
Outdated
Show resolved
Hide resolved
# Conflicts: # dokka-integration-tests/gradle/src/testTemplateProjectConfiguration/kotlin/ConfigurationTest.kt # gradle/libs.versions.toml
Merge Dokkatoo into Dokka repo, and rename it to dokka-gradle-plugin.
DGP-classic has been retained, and can be toggled on/off via a property. (The used name is a placeholder, and can be re-implemented).
The DGP-classic source code has been organised into
src/classicMain
andsrc/classicTest
to help keep it separated, and to prevent mixing it.Only Dokkatoo's HTML format has been copied. GFM, Javadoc, and Jekyll were excluded.
TODO:
dev.adamko...
->org.jetbrains...
enableDokkatoo
-> something else...e: /private/var/folders/_3/ps18c9f56bx2j4fyxt0z7sn40000gp/T/junit17292292638531040000/project/buildSrc/src/main/kotlin/Dokka.kt: (18, 20): Class 'org.jetbrains.dokka.gradle.AbstractDokkaLeafTask' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
UPDATE: fixed by using Java Toolchains & release flag
^OSIP-355