diff --git a/build.gradle.kts b/build.gradle.kts index df910a735ca..064f13d9a23 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -104,6 +104,7 @@ extra["ideaCoreSdkJars"] = arrayOf("annotations", "asm-all", "guava", "intellij- extra["compilerModules"] = arrayOf(":compiler:util", ":compiler:container", + ":compiler:conditional-preprocessor", ":compiler:resolution", ":compiler:serialization", ":compiler:frontend", @@ -111,6 +112,7 @@ extra["compilerModules"] = arrayOf(":compiler:util", ":compiler:frontend.script", ":compiler:cli-common", ":compiler:daemon-common", + ":compiler:daemon", ":compiler:ir.tree", ":compiler:ir.psi2ir", ":compiler:backend-common", diff --git a/compiler/build.gradle.kts b/compiler/build.gradle.kts index d93a8760eb5..4cbb61d7cfe 100644 --- a/compiler/build.gradle.kts +++ b/compiler/build.gradle.kts @@ -1,5 +1,6 @@ import java.io.File +import org.gradle.api.tasks.bundling.Jar apply { plugin("kotlin") } @@ -9,14 +10,6 @@ val compilerModules: Array by rootProject.extra val otherCompilerModules = compilerModules.filter { it != path } dependencies { - compileOnly(project(":compiler:cli")) - compileOnly(project(":compiler:daemon-common")) - compileOnly(project(":compiler:incremental-compilation-impl")) - compileOnly(project(":kotlin-build-common")) - compileOnly(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array))) - compileOnly(commonDep("org.fusesource.jansi", "jansi")) - compileOnly(commonDep("org.jline", "jline")) - testCompile(commonDep("junit:junit")) testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(project(":kotlin-test:kotlin-test-junit")) @@ -40,23 +33,43 @@ dependencies { } sourceSets { - "main" { - java.srcDirs("daemon/src", - "conditional-preprocessor/src") - resources.srcDir("../idea/src").apply { - include("META-INF/extensions/common.xml", - "META-INF/extensions/kotlin2jvm.xml", - "META-INF/extensions/kotlin2js.xml") - } + "main" {} + "test" { + projectDefault() + java.srcDir("tests-ir-jvm/tests") + } +} + +val jar: Jar by tasks +jar.apply { + from(the().sourceSets.getByName("main").output) + from("../idea/src").apply { + include("META-INF/extensions/common.xml", + "META-INF/extensions/kotlin2jvm.xml", + "META-INF/extensions/kotlin2js.xml") } - "test" { projectDefault() } } testsJar {} +// TODO: it seems incomlete, find and add missing dependencies +val testDistProjects = listOf( + ":prepare:mock-runtime-for-test", + ":kotlin-compiler", + ":kotlin-runtime", + ":kotlin-script-runtime", + ":kotlin-stdlib", + ":kotlin-stdlib-jre7", + ":kotlin-stdlib-jre8", + ":kotlin-stdlib-js", + ":kotlin-reflect", + ":kotlin-test:kotlin-test-jvm", + ":kotlin-test:kotlin-test-junit", + ":kotlin-test:kotlin-test-js", + ":kotlin-daemon-client") + projectTest { - dependsOnTaskIfExistsRec("dist", project = rootProject) - dependsOn(":prepare:mock-runtime-for-test:dist") + dependsOn(*testDistProjects.map { "$it:dist" }.toTypedArray()) workingDir = rootDir systemProperty("kotlin.test.script.classpath", the().sourceSets.getByName("test").output.classesDirs.joinToString(File.pathSeparator)) } diff --git a/compiler/conditional-preprocessor/build.gradle.kts b/compiler/conditional-preprocessor/build.gradle.kts new file mode 100644 index 00000000000..0872fa4f77b --- /dev/null +++ b/compiler/conditional-preprocessor/build.gradle.kts @@ -0,0 +1,20 @@ + +apply { plugin("kotlin") } + +jvmTarget = "1.6" + +dependencies { + val compile by configurations + compile(project(":compiler:cli")) + compile(project(":compiler:daemon-common")) + compile(project(":compiler:incremental-compilation-impl")) + compile(project(":kotlin-build-common")) + compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array))) + compile(commonDep("org.fusesource.jansi", "jansi")) + compile(commonDep("org.jline", "jline")) +} + +sourceSets { + "main" { projectDefault() } + "test" {} +} diff --git a/compiler/daemon/build.gradle.kts b/compiler/daemon/build.gradle.kts new file mode 100644 index 00000000000..0872fa4f77b --- /dev/null +++ b/compiler/daemon/build.gradle.kts @@ -0,0 +1,20 @@ + +apply { plugin("kotlin") } + +jvmTarget = "1.6" + +dependencies { + val compile by configurations + compile(project(":compiler:cli")) + compile(project(":compiler:daemon-common")) + compile(project(":compiler:incremental-compilation-impl")) + compile(project(":kotlin-build-common")) + compile(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array))) + compile(commonDep("org.fusesource.jansi", "jansi")) + compile(commonDep("org.jline", "jline")) +} + +sourceSets { + "main" { projectDefault() } + "test" {} +} diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index 97ce3110329..6da54c39927 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -94,11 +94,13 @@ sourceSets { "idea-completion/src", "idea-live-templates/src", "idea-repl/src") + resources.srcDir("idea-maven/resources") } "test" { - java.srcDirs("tests", - "idea-maven/test", - "idea-completion/tests") + projectDefault() + java.srcDirs("idea-maven/test", + "idea-completion/tests", + "idea-live-templates/tests") } } diff --git a/jps-plugin/build.gradle.kts b/jps-plugin/build.gradle.kts index fb3ed4de8f9..36043244ed9 100644 --- a/jps-plugin/build.gradle.kts +++ b/jps-plugin/build.gradle.kts @@ -31,7 +31,8 @@ dependencies { sourceSets { "main" { projectDefault() } "test" { - java.srcDirs("jps-tests/test") + java.srcDirs("jps-tests/test", + "kannotator-jps-plugin-test/test") } } diff --git a/libraries/tools/kotlin-gradle-plugin/build.gradle b/libraries/tools/kotlin-gradle-plugin/build.gradle index e18119657ea..f1d9d5f2bc6 100644 --- a/libraries/tools/kotlin-gradle-plugin/build.gradle +++ b/libraries/tools/kotlin-gradle-plugin/build.gradle @@ -35,7 +35,7 @@ dependencies { compile project(':kotlin-build-common') compile project(':compiler:compiler-runner') compile project(":compiler:incremental-compilation-impl") - compile project(":compiler") + compile project(":compiler:daemon") compile project(':kotlin-annotation-processing') compileOnly 'com.android.tools.build:gradle:2.0.0' diff --git a/settings.gradle b/settings.gradle index f98a54b6d8a..c8402a42fdf 100644 --- a/settings.gradle +++ b/settings.gradle @@ -15,10 +15,12 @@ include ":kotlin-build-common", ":compiler", ":compiler:util", ":compiler:daemon-common", + ":compiler:daemon", ":kotlin-daemon-client", ":kotlin-preloader", ":kotlin-runner", ":compiler:container", + ":compiler:conditional-preprocessor", ":compiler:resolution", ":compiler:serialization", ":compiler:frontend",