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

chore: fix dokka issues execution oom #1479

Closed
wants to merge 11 commits into from
3 changes: 3 additions & 0 deletions .github/workflows/generate-dokka.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
push:
branches:
- develop # later on we should stick to main, since there will be the releases
# remove this after testing on ci
pull_request: # remove this after testing on ci
types: [ opened, edited, synchronize ]

jobs:
publish:
Expand Down
3 changes: 0 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ buildscript {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${libs.versions.kotlin.get()}")
classpath("app.cash.sqldelight:gradle-plugin:${libs.versions.sqldelight.get()}")
classpath("com.wire:carthage-gradle-plugin:${libs.versions.carthage.get()}")
classpath("org.jetbrains.dokka:dokka-gradle-plugin:${libs.versions.dokka.get()}")
classpath("com.google.protobuf:protobuf-gradle-plugin:${libs.versions.protobufCodegen.get()}")
classpath("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:${libs.versions.detekt.get()}")
classpath("io.gitlab.arturbosch.detekt:detekt-cli:${libs.versions.detekt.get()}")
Expand Down Expand Up @@ -118,5 +117,3 @@ kover {
rootProject.plugins.withType<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin> {
rootProject.the<org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension>().nodeVersion = "17.6.0"
}

tasks.dokkaHtmlMultiModule.configure {}
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ val documentedSubprojects = listOf(
"cryptography",
"logger",
"logic",
"network",
"persistence",
"protobuf"
)

/**
Expand All @@ -50,7 +48,7 @@ fun Project.commonDokkaConfig() {
includes.from(it)
}
includes.from(rootProject.file("dokka/moduledoc.md").path)
samples.from(rootProject.file("samples"))
// samples.from(rootProject.file("samples")) // Disabling samples for dokka to avoid OOM
includeNonPublic.set(true)
documentedVisibilities.set(listOf(Visibility.PUBLIC, Visibility.INTERNAL))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class ListenGroupCommand : CliktCommand(name = "listen-group") {
}

while (true) {
val message = readLine()!!
val message = readln()
userSession.messages.sendTextMessage(conversationID, message)
}
}
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#

org.gradle.jvmargs=-Xmx2g -XX:+UseParallelGC
# Increase MaxMetaspaceSize for dokka to avoid OOM
org.gradle.jvmargs=-Xmx4g -XX:+UseParallelGC -XX:MaxMetaspaceSize=2G
android.useAndroidX=true
kotlin.native.binary.memoryModel=experimental
kotlin.js.generate.executable.default=false
kotlin.js.compiler=ir
kotlin.native.binary.freezing=disabled

org.gradle.parallel=true
# Needed for dokka multimodule linking
kotlin.mpp.enableCompatibilityMetadataVariant=true
2 changes: 1 addition & 1 deletion network/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ kotlin {
val commonMain by getting {
dependencies {
implementation(project(":protobuf"))
implementation(project(":util"))
api(project(":logger"))
implementation(project(":util"))

// coroutines
implementation(libs.coroutines.core)
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.mk
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# release related targets, ie: docs, changelog, build aar, etc.
# dokka
doc/generate-kdocs:
./gradlew dokkaHtmlMultiModule
./gradlew -Dorg.gradle.jvmargs=-Xmx8g --stacktrace dokkaHtmlMultiModule