Files
kotlin-fork/libraries/scripting/jsr223-test/build.gradle.kts
T
Nikita Bobko 8f79e833a8 Drop all redundant kotlin-reflect, kotlin-reflect-api dependencies
Review: https://jetbrains.team/p/kt/reviews/6753

All redundant I managed to find, of course.

Why: I'm going to process all reflect dependencies in the next commits.
Cleanup reflect dependency before processing.

They are redundant because:
1. if `compileOnly` then compilation didn't break after dropping the
   dependency
2. if `test*` then tests didn't break after dropping the dependency.
3. `analysis/analysis-api-fir/analysis-api-fir-generator/build.gradle.kts`
   `compiler/fir/checkers/checkers-component-generator/build.gradle.kts`
   Drop `implementation(project(":kotlin-reflect-api"))` because the
   module already depends on
   `implementation(project(":kotlin-reflect"))`
4. `compiler/daemon/daemon-client/build.gradle.kts`. Drop `runtimeOnly`
   because after dropping `compileOnly` compilation didn't break (so
   `runtimeOnly` looks suspicious). Less safe than 1-3
2022-08-22 15:42:57 +02:00

64 lines
2.0 KiB
Kotlin

plugins {
kotlin("jvm")
}
val embeddableTestRuntime by configurations.creating {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.LIBRARY))
}
}
val testJsr223Runtime by configurations.creating {
extendsFrom(configurations["testRuntimeClasspath"])
}
val testCompilationClasspath by configurations.creating
dependencies {
testApi(commonDependency("junit"))
testCompileOnly(project(":kotlin-scripting-jvm-host-unshaded"))
testCompileOnly(project(":compiler:cli"))
testCompileOnly(project(":core:util.runtime"))
testApi(projectTests(":compiler:test-infrastructure-utils"))
testApi(projectTests(":kotlin-scripting-compiler")) { isTransitive = false }
testRuntimeOnly(project(":kotlin-scripting-jsr223-unshaded"))
testRuntimeOnly(project(":kotlin-compiler"))
embeddableTestRuntime(commonDependency("junit"))
embeddableTestRuntime(project(":kotlin-scripting-jsr223"))
embeddableTestRuntime(project(":kotlin-scripting-compiler-embeddable"))
embeddableTestRuntime(testSourceSet.output)
testCompilationClasspath(kotlinStdlib())
}
sourceSets {
"main" {}
"test" { projectDefault() }
}
tasks.withType<org.jetbrains.kotlin.gradle.dsl.KotlinCompile<*>> {
kotlinOptions.freeCompilerArgs += "-Xallow-kotlin-package"
}
projectTest(parallel = true) {
dependsOn(":dist")
workingDir = rootDir
val testRuntimeProvider = project.provider { testJsr223Runtime.asPath }
val testCompilationClasspathProvider = project.provider { testCompilationClasspath.asPath }
doFirst {
systemProperty("testJsr223RuntimeClasspath", testRuntimeProvider.get())
systemProperty("testCompilationClasspath", testCompilationClasspathProvider.get())
}
}
projectTest(taskName = "embeddableTest", parallel = true) {
workingDir = rootDir
dependsOn(embeddableTestRuntime)
classpath = embeddableTestRuntime
}