From 4d65f0478be2597f4cb9b2097832375cf13f7805 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 25 May 2018 09:41:32 +0200 Subject: [PATCH] Move scripting codegen code from tests-common to compiler tests getting rid of dependencies on scripting in the tests-common --- compiler/build.gradle.kts | 3 +++ compiler/tests-common/build.gradle.kts | 3 --- compiler/tests-common/build.gradle.kts.173 | 3 --- compiler/tests-common/build.gradle.kts.182 | 3 --- .../kotlin/codegen/AbstractCustomScriptCodegenTest.kt | 7 +++---- 5 files changed, 6 insertions(+), 13 deletions(-) rename compiler/{tests-common => }/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt (95%) diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 698b21bbac8..6e5bda75c96 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -74,6 +74,9 @@ dependencies { testCompile(projectTests(":generators:test-generator")) testCompile(project(":compiler:ir.ir2cfg")) testCompile(project(":compiler:ir.tree")) // used for deepCopyWithSymbols call that is removed by proguard from the compiler TODO: make it more straightforward + testCompile(project(":kotlin-scripting-compiler")) + testCompile(project(":kotlin-scripting-misc")) + testCompile(project(":kotlin-script-util")) testCompileOnly(projectRuntimeJar(":kotlin-daemon-client")) testCompileOnly(project(":kotlin-reflect-api")) otherCompilerModules.forEach { diff --git a/compiler/tests-common/build.gradle.kts b/compiler/tests-common/build.gradle.kts index bb87198ee9b..f42092dd065 100644 --- a/compiler/tests-common/build.gradle.kts +++ b/compiler/tests-common/build.gradle.kts @@ -28,9 +28,6 @@ dependencies { testCompile(projectTests(":compiler:tests-common-jvm6")) testCompileOnly(project(":kotlin-reflect-api")) testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-scripting-compiler")) - testCompile(project(":kotlin-scripting-misc")) - testCompile(project(":kotlin-script-util")) testCompile(androidDxJar()) { isTransitive = false } testCompile(intellijCoreDep()) { includeJars("intellij-core"); isTransitive = false } testCompile(intellijDep()) { diff --git a/compiler/tests-common/build.gradle.kts.173 b/compiler/tests-common/build.gradle.kts.173 index 2d930548955..6fb1115857d 100644 --- a/compiler/tests-common/build.gradle.kts.173 +++ b/compiler/tests-common/build.gradle.kts.173 @@ -28,9 +28,6 @@ dependencies { testCompile(projectTests(":compiler:tests-common-jvm6")) testCompileOnly(project(":kotlin-reflect-api")) testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-scripting-compiler")) - testCompile(project(":kotlin-scripting-misc")) - testCompile(project(":kotlin-script-util")) testCompile(androidDxJar()) { isTransitive = false } testCompile(intellijCoreDep()) { includeJars("intellij-core"); isTransitive = false } testCompile(intellijDep()) { diff --git a/compiler/tests-common/build.gradle.kts.182 b/compiler/tests-common/build.gradle.kts.182 index f32d5dcfe80..f496aae35c4 100644 --- a/compiler/tests-common/build.gradle.kts.182 +++ b/compiler/tests-common/build.gradle.kts.182 @@ -28,9 +28,6 @@ dependencies { testCompile(projectTests(":compiler:tests-common-jvm6")) testCompileOnly(project(":kotlin-reflect-api")) testCompile(commonDep("junit:junit")) - testCompile(project(":kotlin-scripting-compiler")) - testCompile(project(":kotlin-scripting-misc")) - testCompile(project(":kotlin-script-util")) testCompile(androidDxJar()) { isTransitive = false } testCompile(intellijCoreDep()) { includeJars("intellij-core"); isTransitive = false } testCompile(intellijDep()) { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt similarity index 95% rename from compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt rename to compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt index 921726558f5..2dfaf26cc85 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/AbstractCustomScriptCodegenTest.kt @@ -19,10 +19,9 @@ import kotlin.reflect.full.starProjectedType import kotlin.script.experimental.annotations.KotlinScript import kotlin.script.experimental.annotations.KotlinScriptDefaultCompilationConfiguration import kotlin.script.experimental.api.ScriptCompileConfigurationProperties -import kotlin.script.experimental.misc.invoke import kotlin.script.experimental.util.TypedKey -open class AbstractCustomScriptCodegenTest : CodegenTestCase() { +abstract class AbstractCustomScriptCodegenTest : CodegenTestCase() { private lateinit var scriptDefinitions: List override fun setUp() { @@ -117,7 +116,7 @@ open class AbstractCustomScriptCodegenTest : CodegenTestCase() { object TestScriptWithReceiversConfiguration : ArrayList, Any?>>( listOf( - ScriptCompileConfigurationProperties.scriptImplicitReceivers(String::class.starProjectedType) + ScriptCompileConfigurationProperties.scriptImplicitReceivers to listOf(String::class.starProjectedType) ) ) @@ -128,7 +127,7 @@ abstract class TestScriptWithReceivers object TestScriptWithSimpleEnvVarsConfiguration : ArrayList, Any?>>( listOf( - ScriptCompileConfigurationProperties.contextVariables("stringVar1" to String::class.starProjectedType) + ScriptCompileConfigurationProperties.contextVariables to mapOf("stringVar1" to String::class.starProjectedType) ) )