From 336e24b837986e00da6eaf61cbea40060a7d9729 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Sat, 19 Aug 2017 18:13:26 +0200 Subject: [PATCH] Fix project structure after rebase on master --- build-common/build.gradle.kts | 1 + build.gradle.kts | 3 ++- .../incremental-compilation-impl/build.gradle.kts | 4 ++++ idea/build.gradle.kts | 3 +-- idea/idea-android/build.gradle.kts | 5 +---- .../idea-android-output-parser/build.gradle.kts | 2 +- idea/idea-core/build.gradle.kts | 4 +++- j2k/build.gradle.kts | 1 - jps-plugin/build.gradle.kts | 1 + libraries/commonConfiguration.gradle | 1 + plugins/lint/build.gradle.kts | 3 +-- plugins/uast-kotlin-idea/build.gradle.kts | 1 - plugins/uast-kotlin/build.gradle.kts | 2 +- prepare/compiler/build.gradle.kts | 11 ++++++++--- prepare/kotlin-plugin/build.gradle.kts | 2 +- prepare/mock-runtime-for-test/build.gradle.kts | 12 ++++++++++++ 16 files changed, 38 insertions(+), 18 deletions(-) diff --git a/build-common/build.gradle.kts b/build-common/build.gradle.kts index 5fc8ffe93e1..0ee18f183f5 100644 --- a/build-common/build.gradle.kts +++ b/build-common/build.gradle.kts @@ -8,6 +8,7 @@ dependencies { compile(project(":compiler:util")) compile(project(":compiler:cli-common")) compile(project(":compiler:frontend.java")) + compile(project(":js:js.serializer")) compile(ideaSdkDeps("util")) testCompile(commonDep("junit:junit")) testCompile(project(":compiler.tests-common")) diff --git a/build.gradle.kts b/build.gradle.kts index a23956ea4df..9bde5f1d218 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -99,7 +99,7 @@ extra["versions.javaslang"] = "2.0.6" extra["versions.ant"] = "1.8.2" extra["ideaCoreSdkJars"] = arrayOf("annotations", "asm-all", "guava", "intellij-core", "jdom", "jna", "log4j", "picocontainer", - "snappy-in-java", "trove4j", "xpp3-1.1.4-min", "xstream") + "snappy-in-java", "streamex", "trove4j", "xpp3-1.1.4-min", "xstream") extra["compilerModules"] = arrayOf(":compiler:util", ":compiler:container", @@ -179,6 +179,7 @@ allprojects { tasks.withType { kotlinOptions.freeCompilerArgs = listOf("-Xallow-kotlin-package", "-module-name", project.name) + kotlinOptions.jvmTarget = "1.8" } tasks.withType { diff --git a/compiler/incremental-compilation-impl/build.gradle.kts b/compiler/incremental-compilation-impl/build.gradle.kts index f829bb4d435..a530996996d 100644 --- a/compiler/incremental-compilation-impl/build.gradle.kts +++ b/compiler/incremental-compilation-impl/build.gradle.kts @@ -9,8 +9,12 @@ dependencies { compile(project(":compiler:frontend.java")) compile(project(":compiler:cli")) compile(project(":kotlin-build-common")) + testCompile(project(":kotlin-test:kotlin-test-junit")) + testCompile(project(":kotlin-stdlib")) + testCompile(projectTests(":kotlin-build-common")) } configureKotlinProjectSourcesDefault() configureKotlinProjectTestsDefault() +testsJar() diff --git a/idea/build.gradle.kts b/idea/build.gradle.kts index 842fe26447e..059d93a1593 100644 --- a/idea/build.gradle.kts +++ b/idea/build.gradle.kts @@ -73,8 +73,6 @@ dependencies { testRuntime(ideaPluginDeps("*.jar", plugin = "maven")) testRuntime(ideaPluginDeps("*.jar", plugin = "android")) - testRuntime(preloadedDeps("uast-common", "uast-java")) - // deps below are test runtime deps, but made test compile to split compilation and running to reduce mem req testCompile(project(":android-extensions-compiler")) testCompile(project(":plugins:android-extensions-idea")) { isTransitive = false } @@ -98,6 +96,7 @@ dependencies { configureKotlinProjectSources("src", "idea-maven/src", + "idea-gradle/src", "idea-completion/src", "idea-live-templates/src", "idea-repl/src") diff --git a/idea/idea-android/build.gradle.kts b/idea/idea-android/build.gradle.kts index fb64b9d710a..c9697a371f5 100644 --- a/idea/idea-android/build.gradle.kts +++ b/idea/idea-android/build.gradle.kts @@ -17,8 +17,7 @@ dependencies { compile(project(":idea:ide-common")) compile(ideaSdkDeps("openapi", "idea")) compile(ideaPluginDeps("gradle-tooling-api", plugin = "gradle")) - compile(ideaPluginDeps("android", "common", "sdklib", "sdk-common", "layoutlib-api", plugin = "android")) - compile(preloadedDeps("uast-common", "uast-java")) + compile(ideaPluginDeps("android", "android-common", "sdklib", "sdk-common", "layoutlib-api", plugin = "android")) compile(preloadedDeps("dx", subdir = "android-5.0/lib")) testCompile(project(":kotlin-test:kotlin-test-jvm")) @@ -26,11 +25,9 @@ dependencies { testCompile(project(":idea:idea-test-framework")) { isTransitive = false } testCompile(project(":plugins:lint")) { isTransitive = false } testCompile(projectTests(":idea")) - testCompile(ideaPluginDeps("android-common", "sdklib", plugin = "android")) testCompile(ideaPluginDeps("properties", plugin = "properties")) testCompile(ideaSdkDeps("gson")) - testRuntime(preloadedDeps("uast-common", "uast-java")) testRuntime(project(":plugins:android-extensions-idea")) testRuntime(project(":plugins:sam-with-receiver-ide")) testRuntime(project(":plugins:noarg-ide")) diff --git a/idea/idea-android/idea-android-output-parser/build.gradle.kts b/idea/idea-android/idea-android-output-parser/build.gradle.kts index 794d58e3d03..27686d42a87 100644 --- a/idea/idea-android/idea-android-output-parser/build.gradle.kts +++ b/idea/idea-android/idea-android-output-parser/build.gradle.kts @@ -6,7 +6,7 @@ dependencies { compile(project(":compiler:util")) compile(ideaSdkCoreDeps("intellij-core")) compile(ideaPluginDeps("gradle-tooling-api", plugin = "gradle")) - compile(ideaPluginDeps("android", "common", "sdk-common", plugin = "android")) + compile(ideaPluginDeps("android", "android-common", "sdk-common", plugin = "android")) } configureKotlinProjectSourcesDefault() diff --git a/idea/idea-core/build.gradle.kts b/idea/idea-core/build.gradle.kts index 9d65ce7c7ce..5d6dd3c352b 100644 --- a/idea/idea-core/build.gradle.kts +++ b/idea/idea-core/build.gradle.kts @@ -16,7 +16,7 @@ dependencies { compile(ideaSdkCoreDeps("intellij-core", "util")) compile(ideaSdkDeps("openapi", "idea")) compile(ideaPluginDeps("gradle-tooling-api", "gradle", plugin = "gradle")) - compile(preloadedDeps("uast-common", "kotlinx-coroutines-core", "kotlinx-coroutines-jdk8")) + compile(preloadedDeps("kotlinx-coroutines-core", "kotlinx-coroutines-jdk8")) buildVersion() } @@ -25,3 +25,5 @@ configureKotlinProjectResources("idea-analysis/src", sourcesBaseDir = File(rootD include("**/*.properties") } configureKotlinProjectNoTests() + + diff --git a/j2k/build.gradle.kts b/j2k/build.gradle.kts index 4b37e362264..b2da11ece79 100644 --- a/j2k/build.gradle.kts +++ b/j2k/build.gradle.kts @@ -42,7 +42,6 @@ dependencies { // testRuntime(ideaPluginDeps("*.jar", plugin = "java-i18n")) // testRuntime(ideaPluginDeps("*.jar", plugin = "coverage")) // testRuntime(ideaPluginDeps("*.jar", plugin = "java-decompiler")) -// testRuntime(preloadedDeps("uast-common", "uast-java")) buildVersion() } diff --git a/jps-plugin/build.gradle.kts b/jps-plugin/build.gradle.kts index 347ec690e4d..fb3ed4de8f9 100644 --- a/jps-plugin/build.gradle.kts +++ b/jps-plugin/build.gradle.kts @@ -14,6 +14,7 @@ dependencies { compile(ideaSdkDeps("jps-builders", "jps-builders-6", subdir = "jps")) testCompile(project(":compiler.tests-common")) testCompile(project(":compiler:incremental-compilation-impl")) + testCompile(projectTests(":compiler:incremental-compilation-impl")) testCompileOnly(ideaSdkDeps("jps-build-test", subdir = "jps/test")) testCompile(commonDep("junit:junit")) testCompile(project(":kotlin-test:kotlin-test-jvm")) diff --git a/libraries/commonConfiguration.gradle b/libraries/commonConfiguration.gradle index 933176e2a64..c22be3b5216 100644 --- a/libraries/commonConfiguration.gradle +++ b/libraries/commonConfiguration.gradle @@ -57,6 +57,7 @@ ext.configureJvm6Project = { Project project -> tasks.withType(project.compileKotlin.class) { kotlinOptions.jdkHome = JDK_16 + kotlinOptions.jvmTarget = "1.6" doFirst { System.setProperty("kotlin.colors.enabled", "false") } diff --git a/plugins/lint/build.gradle.kts b/plugins/lint/build.gradle.kts index 9a5daf8ecde..5e1298b9b01 100644 --- a/plugins/lint/build.gradle.kts +++ b/plugins/lint/build.gradle.kts @@ -11,8 +11,7 @@ dependencies { compile(project(":idea:idea-core")) compile(project(":idea:idea-android")) compile(project(":plugins:uast-kotlin")) - compile(preloadedDeps("uast-common", "uast-java")) - compile(ideaPluginDeps("android", "android-common", "common", "sdk-common", "sdklib", "sdk-tools", "repository", "lombok-ast", "kxml2", plugin = "android")) + compile(ideaPluginDeps("android", "android-common", "sdk-common", "sdklib", "sdk-tools", "repository", "lombok-ast", "kxml2", plugin = "android")) compile(ideaSdkCoreDeps("intellij-core", "util")) compile(ideaSdkDeps("guava")) } diff --git a/plugins/uast-kotlin-idea/build.gradle.kts b/plugins/uast-kotlin-idea/build.gradle.kts index 19127a6349c..0d7575775e8 100644 --- a/plugins/uast-kotlin-idea/build.gradle.kts +++ b/plugins/uast-kotlin-idea/build.gradle.kts @@ -9,7 +9,6 @@ dependencies { compile(project(":compiler:frontend.java")) compile(project(":idea:ide-common")) compile(project(":plugins:uast-kotlin")) - compile(preloadedDeps("uast-common", "uast-java")) buildVersion() } diff --git a/plugins/uast-kotlin/build.gradle.kts b/plugins/uast-kotlin/build.gradle.kts index 22fd6482322..51657198558 100644 --- a/plugins/uast-kotlin/build.gradle.kts +++ b/plugins/uast-kotlin/build.gradle.kts @@ -13,7 +13,7 @@ dependencies { compile(project(":compiler:frontend")) compile(project(":compiler:frontend.java")) compile(project(":compiler:light-classes")) - compile(preloadedDeps("uast-common", "uast-java")) + compileOnly(ideaSdkDeps("openapi", "idea")) buildVersion() testCompile(project(":kotlin-test:kotlin-test-jvm")) testCompile(project(":compiler.tests-common")) diff --git a/prepare/compiler/build.gradle.kts b/prepare/compiler/build.gradle.kts index 46322cf5af3..98f62f42086 100644 --- a/prepare/compiler/build.gradle.kts +++ b/prepare/compiler/build.gradle.kts @@ -53,6 +53,9 @@ val packagesToRelocate = "javax.inject", "org.fusesource") +val ideaCoreSdkJars: Array by rootProject.extra +val coreSdkJarsSimple = ideaCoreSdkJars.filterNot { it == "jdom" || it == "log4j" }.toTypedArray() + fun firstFromJavaHomeThatExists(vararg paths: String): File = paths.mapNotNull { File(javaHome, it).takeIf { it.exists() } }.firstOrNull() ?: throw GradleException("Cannot find under '$javaHome' neither of: ${paths.joinToString()}") @@ -73,9 +76,8 @@ dependencies { // buildVersion() fatJarContents(project(":core:builtins", configuration = "builtins")) - fatJarContents(ideaSdkCoreDeps(*(rootProject.extra["ideaCoreSdkJars"] as Array))) - fatJarContents(ideaSdkDeps("jna-platform", "oromatcher")) - fatJarContents(ideaSdkDeps("jps-model.jar", subdir = "jps")) + fatJarContents(ideaSdkCoreDeps(*coreSdkJarsSimple)) + fatJarContents(ideaSdkDeps("jna-platform")) fatJarContents(commonDep("javax.inject")) fatJarContents(commonDep("org.jline", "jline")) fatJarContents(protobufFull()) @@ -106,6 +108,9 @@ val packCompiler by task { setupPublicJar("before-proguard", "") from(fatJarContents) + ideaSdkDeps("jps-model.jar", subdir = "jps").forEach { from(it) { exclude("META-INF/services/**") } } + ideaSdkDeps("oromatcher").forEach { from(it) { exclude("META-INF/jb/** META-INF/LICENSE") } } + ideaSdkCoreDeps("jdom", "log4j").forEach { from(it) { exclude("META-INF/jb/** META-INF/LICENSE") } } manifest.attributes.put("Class-Path", compilerManifestClassPath) manifest.attributes.put("Main-Class", "org.jetbrains.kotlin.cli.jvm.K2JVMCompiler") diff --git a/prepare/kotlin-plugin/build.gradle.kts b/prepare/kotlin-plugin/build.gradle.kts index 185fd6d6cf0..4cdacdf62e2 100644 --- a/prepare/kotlin-plugin/build.gradle.kts +++ b/prepare/kotlin-plugin/build.gradle.kts @@ -57,7 +57,7 @@ dependencies { sideJars(project(":kotlin-script-runtime")) sideJars(commonDep("io.javaslang", "javaslang")) sideJars(commonDep("javax.inject")) - sideJars(preloadedDeps("markdown", "kotlinx-coroutines-core", "kotlinx-coroutines-jdk8", "uast-java")) + sideJars(preloadedDeps("markdown", "kotlinx-coroutines-core", "kotlinx-coroutines-jdk8")) } val targetJar = File(buildDir, "libs", "kotlin-plugin.jar") diff --git a/prepare/mock-runtime-for-test/build.gradle.kts b/prepare/mock-runtime-for-test/build.gradle.kts index 14532652513..632ae42efae 100644 --- a/prepare/mock-runtime-for-test/build.gradle.kts +++ b/prepare/mock-runtime-for-test/build.gradle.kts @@ -2,6 +2,7 @@ import org.gradle.jvm.tasks.Jar import org.gradle.api.internal.HasConvention import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile apply { plugin("kotlin") } @@ -34,6 +35,17 @@ configure { configureKotlinProjectNoTests() +tasks.withType { + sourceCompatibility = "1.6" + targetCompatibility = "1.6" +// options.fork = true + options.forkOptions.javaHome = file(rootProject.extra["JDK_16"] as String) +} + +tasks.withType { + kotlinOptions.jvmTarget = "1.6" + kotlinOptions.jdkHome = rootProject.extra["JDK_16"] as String +} task("dist") { into(rootProject.extra["distDir"].toString())