From 3569cdda38053f0cc97489b5a6d92e28f4a78956 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Fri, 27 May 2022 07:33:03 +0200 Subject: [PATCH] JPS plugin: use single source of truth for the classpath Before this commit `jps/jps-*/build.gradle.kts` list of dependencies were partially duplicated in the `compilerModulesForJps` Right now, list of all JPS dependencies is the source of truth. Actually, I wish I could it do it the other way around -- let the Gradle do dependency management and correctly produce jars with as less as possible other libraries being embedded, and as much as poosible libraries being just dependencies in the pom.xml. I tried to do so using `embedded` and self-made configurations but desperately failed, because was getting to big `kotlin-jps-plugin-classpath` jar. Probably, what I was getting is a correct classpath, and currently hardcoded classpath may not be correctly full. Well, at least current classpath is time-proven. --- jps/jps-common/build.gradle.kts | 9 ++++----- jps/jps-plugin/build.gradle.kts | 15 +++++---------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/jps/jps-common/build.gradle.kts b/jps/jps-common/build.gradle.kts index b65813762d8..ad19a564529 100644 --- a/jps/jps-common/build.gradle.kts +++ b/jps/jps-common/build.gradle.kts @@ -6,11 +6,10 @@ plugins { dependencies { implementation(kotlinStdlib()) - implementation(project(":compiler:util")) - implementation(project(":compiler:cli-common")) - implementation(project(":compiler:frontend.java")) - implementation(project(":js:js.frontend")) - implementation(project(":kotlin-reflect")) + rootProject.extra["compilerModulesForJps"] + .let { it as List } + .forEach { implementation(project(it)) } + compileOnly(intellijUtilRt()) compileOnly(intellijPlatformUtil()) compileOnly(jpsModel()) diff --git a/jps/jps-plugin/build.gradle.kts b/jps/jps-plugin/build.gradle.kts index 01f6a0f0c06..f35128fe3d7 100644 --- a/jps/jps-plugin/build.gradle.kts +++ b/jps/jps-plugin/build.gradle.kts @@ -15,18 +15,13 @@ val generateTests by generator("org.jetbrains.kotlin.jps.GenerateJpsPluginTestsK } dependencies { - implementation(project(":kotlin-build-common")) - implementation(project(":core:descriptors")) - implementation(project(":core:descriptors.jvm")) - implementation(project(":kotlin-compiler-runner-unshaded")) - implementation(project(":daemon-common")) - implementation(project(":daemon-common-new")) - implementation(project(":kotlin-daemon-client")) compileOnly(project(":jps:jps-platform-api-signatures")) testImplementation(projectTests(":generators:test-generator")) - implementation(project(":compiler:frontend.java")) - implementation(project(":js:js.frontend")) - implementation(project(":kotlin-preloader")) + + rootProject.extra["compilerModulesForJps"] + .let { it as List } + .forEach { implementation(project(it)) } + implementation(project(":jps:jps-common")) compileOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil")) compileOnly(jpsModel())