diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index 310d1edfec7..1c9b00d5728 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -40,6 +40,8 @@ val testJvm6ServerRuntime by configurations.creating val antLauncherJar by configurations.creating dependencies { + testRuntime(intellijDep()) // Should come before compiler, because of "progarded" stuff needed for tests + depDistProjects.forEach { testCompile(projectDist(it)) } @@ -62,7 +64,6 @@ dependencies { testRuntime(projectDist(":kotlin-daemon-client")) testRuntime(androidDxJar()) testRuntime(files(toolsJar())) - testRuntime(intellijDep()) testJvm6ServerRuntime(projectTests(":compiler:tests-common-jvm6")) diff --git a/compiler/tests-java8/build.gradle.kts b/compiler/tests-java8/build.gradle.kts index 1cc7d8cde77..f3e7827c184 100644 --- a/compiler/tests-java8/build.gradle.kts +++ b/compiler/tests-java8/build.gradle.kts @@ -4,7 +4,7 @@ apply { plugin("kotlin") } dependencies { testCompile(projectTests(":compiler:tests-common")) - testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } + testCompile(intellijCoreDep()) { includeJars("intellij-core") } testCompile(projectTests(":generators:test-generator")) testRuntime(projectDist(":kotlin-reflect")) testRuntime(intellijDep()) diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index 2b9a409094f..01a70e1f399 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -3,6 +3,8 @@ import org.gradle.jvm.tasks.Jar apply { plugin("kotlin") } dependencies { + testRuntime(intellijDep()) + compile(project(":kotlin-stdlib")) compileOnly(project(":kotlin-reflect-api")) compile(project(":core:descriptors")) @@ -72,7 +74,7 @@ dependencies { (rootProject.extra["compilerModules"] as Array).forEach { testCompile(project(it)) } - testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } + testCompile(intellijCoreDep()) { includeJars("intellij-core") } testCompile(intellijPluginDep("IntelliLang")) testCompile(intellijPluginDep("copyright")) testCompile(intellijPluginDep("properties")) @@ -83,7 +85,6 @@ dependencies { testCompileOnly(intellijPluginDep("Groovy")) { includeJars("Groovy") } testCompileOnly(intellijPluginDep("maven")) { includeJars("maven", "maven-server-api") } - testRuntime(intellijDep()) testRuntime(intellijPluginDep("junit")) testRuntime(intellijPluginDep("gradle")) testRuntime(intellijPluginDep("Groovy")) diff --git a/idea/idea-android/build.gradle.kts b/idea/idea-android/build.gradle.kts index ac1112d323f..62ea18e4333 100644 --- a/idea/idea-android/build.gradle.kts +++ b/idea/idea-android/build.gradle.kts @@ -45,6 +45,7 @@ dependencies { testRuntime(project(":noarg-ide-plugin")) testRuntime(project(":allopen-ide-plugin")) + testRuntime(intellijCoreDep()) { includeJars("intellij-core") } testRuntime(intellijDep()) testRuntime(intellijPluginDep("android")) testRuntime(intellijPluginDep("copyright")) diff --git a/idea/idea-gradle/build.gradle.kts b/idea/idea-gradle/build.gradle.kts index ea8653d0025..e49c511e70d 100644 --- a/idea/idea-gradle/build.gradle.kts +++ b/idea/idea-gradle/build.gradle.kts @@ -3,6 +3,7 @@ apply { plugin("kotlin") } val androidSdk by configurations.creating dependencies { + testRuntime(intellijDep()) compileOnly(project(":idea")) compileOnly(project(":idea:idea-jvm")) @@ -35,7 +36,6 @@ dependencies { testRuntime(project(":sam-with-receiver-ide-plugin")) testRuntime(project(":allopen-ide-plugin")) testRuntime(project(":noarg-ide-plugin")) - testRuntime(intellijDep()) // TODO: the order of the plugins matters here, consider avoiding order-dependency testRuntime(intellijPluginDep("junit")) testRuntime(intellijPluginDep("testng")) { includeJars("jcommander", "resources_en") } diff --git a/idea/tests/org/jetbrains/kotlin/idea/highlighter/NoErrorsInStdlibTest.kt b/idea/tests/org/jetbrains/kotlin/idea/highlighter/NoErrorsInStdlibTest.kt index 12f654d04bb..a1d550f3459 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/highlighter/NoErrorsInStdlibTest.kt +++ b/idea/tests/org/jetbrains/kotlin/idea/highlighter/NoErrorsInStdlibTest.kt @@ -32,7 +32,8 @@ import java.io.File class NoErrorsInStdlibTest : KotlinLightCodeInsightFixtureTestCase() { fun testNoErrors() { - val root = myFixture.copyDirectoryToProject("../libraries/stdlib/src", "") + val relativePathToProjectRoot = File(System.getProperty("user.dir")).relativeTo(File(myFixture.testDataPath)).path + val root = myFixture.copyDirectoryToProject("$relativePathToProjectRoot/libraries/stdlib/src", "") val psiManager = psiManager // workaround for KT-3974 IllegalAccessError when accessing protected method inherited by outer class diff --git a/j2k/build.gradle.kts b/j2k/build.gradle.kts index 1064961466b..c1582fb1f92 100644 --- a/j2k/build.gradle.kts +++ b/j2k/build.gradle.kts @@ -18,6 +18,8 @@ val usedIntellijPlugins = arrayOf( "java-decompiler") dependencies { + testRuntime(intellijDep()) + compile(projectDist(":kotlin-stdlib")) compile(project(":compiler:frontend")) compile(project(":compiler:frontend.java")) @@ -38,7 +40,6 @@ dependencies { testRuntime(project(":sam-with-receiver-ide-plugin")) testRuntime(project(":allopen-ide-plugin")) testRuntime(project(":noarg-ide-plugin")) - testRuntime(intellijDep()) usedIntellijPlugins.forEach { testRuntime(intellijPluginDep(it)) } diff --git a/js/js.tests/build.gradle.kts b/js/js.tests/build.gradle.kts index 149daf4e2ea..a8441c348bf 100644 --- a/js/js.tests/build.gradle.kts +++ b/js/js.tests/build.gradle.kts @@ -15,12 +15,14 @@ apply { plugin("kotlin") } val antLauncherJar by configurations.creating dependencies { + testRuntime(intellijDep()) + testCompile(protobufFull()) testCompile(projectTests(":compiler:tests-common")) testCompileOnly(project(":compiler:frontend")) testCompileOnly(project(":compiler:cli")) testCompileOnly(project(":compiler:util")) - testCompileOnly(intellijCoreDep()) { includeJars("intellij-core") } + testCompile(intellijCoreDep()) { includeJars("intellij-core") } testCompileOnly(intellijDep()) { includeJars("openapi", "idea", "idea_rt", "util") } testCompile(project(":js:js.translator")) testCompile(project(":js:js.serializer")) @@ -36,7 +38,6 @@ dependencies { testRuntime(projectDist(":kotlin-preloader")) // it's required for ant tests testRuntime(project(":compiler:backend-common")) testRuntime(commonDep("org.fusesource.jansi", "jansi")) - testRuntime(intellijDep()) antLauncherJar(commonDep("org.apache.ant", "ant")) antLauncherJar(files(toolsJar())) diff --git a/plugins/allopen/allopen-cli/build.gradle.kts b/plugins/allopen/allopen-cli/build.gradle.kts index aebbf24164f..8ba0f4436ca 100644 --- a/plugins/allopen/allopen-cli/build.gradle.kts +++ b/plugins/allopen/allopen-cli/build.gradle.kts @@ -4,6 +4,8 @@ description = "Kotlin AllOpen Compiler Plugin" apply { plugin("kotlin") } dependencies { + testRuntime(intellijDep()) + compileOnly(project(":compiler:plugin-api")) compileOnly(project(":compiler:frontend")) compileOnly(intellijCoreDep()) { includeJars("intellij-core") } @@ -16,8 +18,6 @@ dependencies { testCompile(project(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common")) testCompile(commonDep("junit:junit")) - - testRuntime(intellijDep()) } sourceSets { @@ -40,4 +40,4 @@ ideaPlugin { projectTest { workingDir = rootDir -} \ No newline at end of file +} diff --git a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts index 602c806b98a..cc98080e6b8 100644 --- a/plugins/android-extensions/android-extensions-compiler/build.gradle.kts +++ b/plugins/android-extensions/android-extensions-compiler/build.gradle.kts @@ -7,6 +7,8 @@ val robolectricClasspath by configurations.creating val androidJar by configurations.creating dependencies { + testCompile(intellijCoreDep()) { includeJars("intellij-core") } + compile(project(":compiler:util")) compile(project(":compiler:plugin-api")) compile(project(":compiler:frontend")) @@ -58,4 +60,4 @@ projectTest { systemProperty("robolectric.classpath", robolectricClasspath.asPath) systemProperty("android.jar", androidJar.singleFile.canonicalPath) } -} \ No newline at end of file +} diff --git a/plugins/kapt3/kapt3-compiler/build.gradle.kts b/plugins/kapt3/kapt3-compiler/build.gradle.kts index 6986bb1ea1b..c9d3eb7a10f 100644 --- a/plugins/kapt3/kapt3-compiler/build.gradle.kts +++ b/plugins/kapt3/kapt3-compiler/build.gradle.kts @@ -4,6 +4,10 @@ description = "Annotation Processor for Kotlin" apply { plugin("kotlin") } dependencies { + testRuntime(intellijDep()) + testCompile(intellijCoreDep()) { includeJars("intellij-core") } + testCompileOnly(intellijDep()) { includeJars("idea", "idea_rt", "openapi") } + compile(project(":compiler:util")) compile(project(":compiler:cli")) compile(project(":compiler:backend")) @@ -17,8 +21,6 @@ dependencies { testCompile(project(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common")) testCompile(commonDep("junit:junit")) - testCompile(intellijCoreDep()) { includeJars("intellij-core") } - testCompile(intellijDep()) { includeJars("idea", "idea_rt", "openapi") } testCompile(project(":kotlin-annotation-processing-runtime")) } diff --git a/plugins/noarg/noarg-cli/build.gradle.kts b/plugins/noarg/noarg-cli/build.gradle.kts index 518d830dfc0..61f3e092a54 100644 --- a/plugins/noarg/noarg-cli/build.gradle.kts +++ b/plugins/noarg/noarg-cli/build.gradle.kts @@ -4,6 +4,8 @@ description = "Kotlin NoArg Compiler Plugin" apply { plugin("kotlin") } dependencies { + testRuntime(intellijDep()) + compileOnly(project(":compiler:frontend")) compileOnly(project(":compiler:frontend.java")) compileOnly(project(":compiler:backend")) @@ -19,8 +21,6 @@ dependencies { testCompile(project(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common")) testCompile(commonDep("junit:junit")) - - testRuntime(intellijDep()) } sourceSets { @@ -43,4 +43,4 @@ ideaPlugin { projectTest { workingDir = rootDir -} \ No newline at end of file +} diff --git a/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts b/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts index a6081d2f452..c97d0c5656d 100644 --- a/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts +++ b/plugins/sam-with-receiver/sam-with-receiver-cli/build.gradle.kts @@ -4,6 +4,9 @@ description = "Kotlin SamWithReceiver Compiler Plugin" apply { plugin("kotlin") } dependencies { + testRuntime(intellijCoreDep()) { includeJars("intellij-core") } + testRuntime(intellijDep()) + compileOnly(project(":compiler:frontend")) compileOnly(project(":compiler:frontend.java")) compileOnly(project(":compiler:plugin-api")) @@ -17,7 +20,6 @@ dependencies { testCompile(project(":compiler:tests-common")) testCompile(projectTests(":compiler:tests-common")) testCompile(commonDep("junit:junit")) - testRuntime(intellijDep()) } sourceSets { @@ -45,4 +47,4 @@ ideaPlugin { projectTest { workingDir = rootDir -} \ No newline at end of file +} diff --git a/ultimate/build.gradle.kts b/ultimate/build.gradle.kts index 7660627ac1b..997641014fa 100644 --- a/ultimate/build.gradle.kts +++ b/ultimate/build.gradle.kts @@ -48,9 +48,9 @@ dependencies { compileOnly(intellijPluginDep("NodeJS")) testCompile(projectDist(":kotlin-test:kotlin-test-jvm")) - testCompile(project(":idea:idea-test-framework")) { isTransitive = false } - testCompile(project(":plugins:lint")) { isTransitive = false } - testCompile(project(":idea:idea-jvm")) { isTransitive = false } + testCompileOnly(project(":idea:idea-test-framework")) { isTransitive = false } + testCompileOnly(project(":plugins:lint")) { isTransitive = false } + testCompileOnly(project(":idea:idea-jvm")) { isTransitive = false } testCompile(projectTests(":compiler:tests-common")) testCompile(projectTests(":idea")) { isTransitive = false } testCompile(projectTests(":generators:test-generator")) @@ -77,7 +77,10 @@ dependencies { testRuntime(project(":plugins:uast-kotlin")) testRuntime(project(":plugins:uast-kotlin-idea")) testRuntime(files("${System.getProperty("java.home")}/../lib/tools.jar")) - testRuntime(project(":plugins:kapt3-idea")) { isTransitive = false } + testRuntime(project(":plugins:kapt3-idea")) + testRuntime(project(":idea:idea-test-framework")) + testRuntime(project(":plugins:lint")) + testRuntime(project(":idea:idea-jvm")) springClasspath(commonDep("org.springframework", "spring-core")) springClasspath(commonDep("org.springframework", "spring-beans"))