Skip to content

Commit

Permalink
Merge branch 'master' into feat/migrate_test_utils_to_test_fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
aSemy committed Apr 19, 2023
2 parents ca25fd7 + 115a318 commit 3fc3dc8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.jetbrains.conventions

import org.gradle.internal.component.external.model.TestFixturesSupport.TEST_FIXTURE_SOURCESET_NAME
import com.github.jengelman.gradle.plugins.shadow.ShadowPlugin

plugins {
id("org.jetbrains.conventions.base")
Expand Down Expand Up @@ -65,3 +66,11 @@ binaryCompatibilityValidator {
enabled.set(true)
}
}

plugins.withType<ShadowPlugin>().configureEach {
// manually disable publication of Shadow elements https://github.com/johnrengelman/shadow/issues/651#issue-839148311
// This is done to preserve compatibility and have the same behaviour as previous versions of Dokka.
// For more details, see https://github.com/Kotlin/dokka/pull/2704#issuecomment-1499517930
val javaComponent = components["java"] as AdhocComponentWithVariants
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() }
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import org.gradle.work.DisableCachingByDefault
import org.jetbrains.dokka.*
import org.jetbrains.dokka.plugability.ConfigurableBlock
import org.jetbrains.dokka.plugability.DokkaPlugin
import java.util.concurrent.atomic.AtomicReference
import java.util.function.BiConsumer
import kotlin.reflect.full.createInstance

Expand Down Expand Up @@ -203,14 +204,17 @@ abstract class AbstractDokkaTask : DefaultTask() {
internal open fun generateDocumentation() {
DokkaBootstrap(runtime, DokkaBootstrapImpl::class).apply {
configure(buildDokkaConfiguration().toCompactJsonString(), createProxyLogger())
val uncaughtExceptionHolder = AtomicReference<Throwable?>()
/**
* Run in a new thread to avoid memory leaks that are related to ThreadLocal (that keeps `URLCLassLoader`)
* Currently, all `ThreadLocal`s leaking are in the compiler/IDE codebase.
*/
Thread { generate() }.apply {
setUncaughtExceptionHandler { _, throwable -> uncaughtExceptionHolder.set(throwable) }
start()
join()
}
uncaughtExceptionHolder.get()?.let { throw it }
}
}

Expand Down

0 comments on commit 3fc3dc8

Please sign in to comment.