Skip to content

Commit b4ccab3

Browse files
committed
chore: bump Dokka to v2, and reduce Gradle daemon memory consumption
Previously, Dokka (kotlin doc + javadoc) was running within Gradle Daemon process, so it required every Gradle Daemon to allocate lots of heap. The change allows reducing heap consumption
1 parent 85a9bc4 commit b4ccab3

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

build-logic/jvm/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ dependencies {
2727
api("com.github.vlsi.gradle-extensions:com.github.vlsi.gradle-extensions.gradle.plugin:1.90")
2828
api("org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:1.9.22")
2929
api("org.jetbrains.kotlin.kapt:org.jetbrains.kotlin.kapt.gradle.plugin:1.9.22")
30-
api("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:1.9.10")
30+
api("org.jetbrains.dokka:org.jetbrains.dokka.gradle.plugin:2.0.0")
3131
}

build-logic/jvm/src/main/kotlin/build-logic.dokka-javadoc.gradle.kts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
plugins {
1919
id("java-base")
20-
id("org.jetbrains.dokka")
20+
id("org.jetbrains.dokka-javadoc")
2121
}
2222

2323
java {
@@ -30,15 +30,21 @@ tasks.named<Jar>("javadocJar") {
3030
archiveClassifier.set("javadoc_java")
3131
}
3232

33-
tasks.dokkaJavadoc {
34-
moduleName.set("Apache JMeter ${project.name}")
33+
dokka {
34+
moduleName = "Apache JMeter ${project.name}"
35+
dokkaGeneratorIsolation = ProcessIsolation {
36+
maxHeapSize = "2g"
37+
}
38+
}
39+
40+
tasks.dokkaGeneratePublicationJavadoc {
3541
mustRunAfter("kaptKotlin")
3642
}
3743

3844
val dokkaJar by tasks.registering(Jar::class) {
3945
group = LifecycleBasePlugin.BUILD_GROUP
4046
description = "Assembles a jar archive containing javadoc"
41-
from(tasks.dokkaJavadoc)
47+
from(tasks.dokkaGeneratePublicationJavadoc)
4248
archiveClassifier.set("javadoc")
4349
}
4450

gradle.properties

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# limitations under the License.
1616
#
1717

18-
org.gradle.jvmargs=-Xmx700m -XX:MaxMetaspaceSize=368m
18+
org.gradle.jvmargs=-Xms128m -Xmx768m -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError
1919
org.gradle.parallel=true
2020
# Build cache can be disabled with --no-build-cache option
2121
org.gradle.caching=true
@@ -24,6 +24,10 @@ org.gradle.dependency.verification.console=verbose
2424

2525
kapt.include.compile.classpath=false
2626

27+
# Kotlin Dokka is experemental, and we want silence the build warning
28+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
29+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
30+
2731
# See https://github.com/gradle/gradle/pull/11358 , https://issues.apache.org/jira/browse/INFRA-14923
2832
# repository.apache.org does not yet support .sha256 and .sha512 checksums
2933
systemProp.org.gradle.internal.publish.checksums.insecure=true

gradle/verification-metadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@
207207
<trusting group="org.apache.commons"/>
208208
<trusting group="org.xmlunit"/>
209209
</trusted-key>
210+
<trusted-key id="CFBE6E7934FB211224EE1C2B0C0A9468268C79AE" group="org.jetbrains"/>
210211
<trusted-key id="D022218DCC08AAD6EF3AF876B3DE72E647D35161" group="org.testcontainers"/>
211212
<trusted-key id="D112630C899F508198C09018105CB91CAC2AEE0E">
212213
<trusting group="com.github.autostyle"/>
@@ -508,6 +509,11 @@
508509
<sha256 value="27bb52753f97b2cbedd5ad72e111e05e53e0b08a4d22a2aaa80069df5d527ae1" origin="Generated by Gradle" reason="Artifact is not signed"/>
509510
</artifact>
510511
</component>
512+
<component group="org.jetbrains.dokka" name="org.jetbrains.dokka.gradle.plugin" version="2.0.0">
513+
<artifact name="org.jetbrains.dokka.gradle.plugin-2.0.0.pom">
514+
<sha256 value="e1fc686a01837e7e86291185901507ffeaf794b8a9ec947b5d04368fa70e00ca" origin="Generated by Gradle" reason="Artifact is not signed"/>
515+
</artifact>
516+
</component>
511517
<component group="org.jetbrains.gradle.plugin.idea-ext" name="org.jetbrains.gradle.plugin.idea-ext.gradle.plugin" version="1.1.7">
512518
<artifact name="org.jetbrains.gradle.plugin.idea-ext.gradle.plugin-1.1.7.pom">
513519
<sha256 value="b953806a04ecd62b1bc87f81da56e809f5f0d7881c181f056554805af8664eb9" origin="Generated by Gradle" reason="Artifact is not signed"/>

0 commit comments

Comments
 (0)