Repository: Kotlin/kotlinx.coroutines
File: kotlinx-coroutines-debug/build.gradle.kts (Kotlin)

Code before:
/*
 * Copyright 2016-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

import com.github.jengelman.gradle.plugins.shadow.tasks.*

apply(plugin = "com.github.johnrengelman.shadow")

// apply plugin to use autocomplete for Kover DSL
apply(plugin = "org.jetbrains.kotlinx.kover")

configurations {
    val shadowDeps by creating // shaded dependencies, not included into the resulting .pom file
    compileOnly.get().extendsFrom(shadowDeps)
    runtimeOnly.get().extendsFrom(shadowDeps)
}

val junit_version by properties
val junit5_version by properties
val byte_buddy_version by properties
val blockhound_version by properties
val jna_version by properties

dependencies {
    compileOnly("junit:junit:$junit_version")
    compileOnly("org.junit.jupiter:junit-jupiter-api:$junit5_version")
    testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit5_version")
    testImplementation("org.junit.platform:junit-platform-testkit:1.7.0")
    add("shadowDeps", "net.bytebuddy:byte-buddy:$byte_buddy_version")
    add("shadowDeps", "net.bytebuddy:byte-buddy-agent:$byte_buddy_version")
    compileOnly("io.projectreactor.tools:blockhound:$blockhound_version")
    testImplementation("io.projectreactor.tools:blockhound:$blockhound_version")
    testImplementation("com.google.code.gson:gson:2.8.6")
    api("net.java.dev.jna:jna:$jna_version")
    api("net.java.dev.jna:jna-platform:$jna_version")
}

java {
    /* This is needed to be able to run JUnit5 tests. Otherwise, Gradle complains that it can't find the
    JVM1.6-compatible version of the `junit-jupiter-api` artifact. */
    disableAutoTargetJvm()
}

// This is required for BlockHound tests to work, see https://github.com/Kotlin/kotlinx.coroutines/issues/3701
tasks.withType<Test>().configureEach {
    if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_13)) {
        jvmArgs("-XX:+AllowRedefinitionToAddDeleteMethods")

Review comment (suggestion):
```suggestion
configurations{
  val shadowDeps by creating
  compileOnly.configure {
    extendsFrom(shadowDeps)
  }
  runtimeOnly.configure {
    extendsFrom(shadowDeps)
  }
}
```

Avoids `compileOnly` and `runtimeOnly` to be created/configured eagerly. (Configuration avoidance)

Code after:
/*
 * Copyright 2016-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
 */

import com.github.jengelman.gradle.plugins.shadow.tasks.*
import java.net.*
import java.nio.file.*

plugins {
    id("com.github.johnrengelman.shadow")
    id("org.jetbrains.kotlinx.kover") // apply plugin to use autocomplete for Kover DSL
}

configurations {
    val shadowDeps by creating
    compileOnly.configure {
        extendsFrom(shadowDeps)
    }
    runtimeOnly.configure {
        extendsFrom(shadowDeps)
    }
}

val junit_version by properties
val junit5_version by properties
val byte_buddy_version by properties
val blockhound_version by properties
val jna_version by properties

dependencies {
    compileOnly("junit:junit:$junit_version")
    compileOnly("org.junit.jupiter:junit-jupiter-api:$junit5_version")
    testImplementation("org.junit.jupiter:junit-jupiter-engine:$junit5_version")
    testImplementation("org.junit.platform:junit-platform-testkit:1.7.0")
    add("shadowDeps", "net.bytebuddy:byte-buddy:$byte_buddy_version")
    add("shadowDeps", "net.bytebuddy:byte-buddy-agent:$byte_buddy_version")
    compileOnly("io.projectreactor.tools:blockhound:$blockhound_version")
    testImplementation("io.projectreactor.tools:blockhound:$blockhound_version")
    testImplementation("com.google.code.gson:gson:2.8.6")
    api("net.java.dev.jna:jna:$jna_version")
    api("net.java.dev.jna:jna-platform:$jna_version")
}

java {
    /* This is needed to be able to run JUnit5 tests. Otherwise, Gradle complains that it can't find the
    JVM1.6-compatible version of the `junit-jupiter-api` artifact. */
    disableAutoTargetJvm()