JPS plugin: Cleanup dependencies

- Some unnecessary dependencies are dropped
- `api` is replaced with `implementation` when it's more appropriate (in
  our case more appropriate everywhere). `implementation` makes it
  easier to analyze dependencies because it doesn't export the
  dependencies
- Regarding: `// Workaround for Gradle dependency resolution error`.
  Actually, it's not longer needed for the successful project import.
  Confirmed by Yahor and tested locally.
This commit is contained in:
Nikita Bobko
2022-05-26 21:02:21 +02:00
parent b06aae229a
commit 0cb256a999
3 changed files with 30 additions and 43 deletions
@@ -6,9 +6,8 @@ plugins {
} }
dependencies { dependencies {
api(project(":kotlin-build-common")) implementation(project(":kotlin-daemon-client"))
api(project(":kotlin-daemon-client")) implementation(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
api(commonDependency("org.jetbrains.kotlinx", "kotlinx-coroutines-core")) { isTransitive = false }
compileOnly(project(":compiler:cli-common")) compileOnly(project(":compiler:cli-common"))
compileOnly(project(":kotlin-preloader")) compileOnly(project(":kotlin-preloader"))
+10 -10
View File
@@ -5,22 +5,22 @@ plugins {
} }
dependencies { dependencies {
api(kotlinStdlib()) implementation(kotlinStdlib())
compileOnly(project(":kotlin-reflect-api")) implementation(project(":compiler:util"))
testImplementation(project(":kotlin-reflect")) implementation(project(":compiler:cli-common"))
api(project(":compiler:util")) implementation(project(":compiler:frontend.java"))
api(project(":compiler:cli-common")) implementation(project(":js:js.frontend"))
api(project(":compiler:frontend.java")) implementation(project(":kotlin-reflect"))
api(project(":js:js.frontend"))
api(project(":native:frontend.native"))
compileOnly(intellijUtilRt()) compileOnly(intellijUtilRt())
compileOnly(intellijPlatformUtil()) compileOnly(intellijPlatformUtil())
compileOnly(jpsModel()) compileOnly(jpsModel())
compileOnly(jpsModelImpl()) compileOnly(jpsModelImpl())
compileOnly(jpsModelSerialization()) compileOnly(jpsModelSerialization())
testApi(jpsModelSerialization()) testImplementation(project(":compiler:cli-common"))
testApi(commonDependency("junit:junit")) testImplementation(jpsModelSerialization())
testImplementation(project(":kotlin-reflect"))
testImplementation(commonDependency("junit:junit"))
} }
sourceSets { sourceSets {
+18 -30
View File
@@ -15,31 +15,28 @@ val generateTests by generator("org.jetbrains.kotlin.jps.GenerateJpsPluginTestsK
} }
dependencies { dependencies {
api(project(":kotlin-build-common")) implementation(project(":kotlin-build-common"))
api(project(":core:descriptors")) implementation(project(":core:descriptors"))
api(project(":core:descriptors.jvm")) implementation(project(":core:descriptors.jvm"))
api(project(":kotlin-compiler-runner-unshaded")) implementation(project(":kotlin-compiler-runner-unshaded"))
api(project(":kotlin-compiler-runner")) implementation(project(":daemon-common"))
api(project(":daemon-common")) implementation(project(":daemon-common-new"))
api(project(":daemon-common-new")) implementation(project(":kotlin-daemon-client"))
api(project(":kotlin-daemon-client"))
api(project(":kotlin-daemon"))
compileOnly(project(":jps:jps-platform-api-signatures")) compileOnly(project(":jps:jps-platform-api-signatures"))
testImplementation(projectTests(":generators:test-generator")) testImplementation(projectTests(":generators:test-generator"))
api(project(":compiler:frontend.java")) implementation(project(":compiler:frontend.java"))
api(project(":js:js.frontend")) implementation(project(":js:js.frontend"))
api(project(":kotlin-preloader")) implementation(project(":kotlin-preloader"))
api(project(":jps:jps-common")) implementation(project(":jps:jps-common"))
compileOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil")) compileOnly(commonDependency("org.jetbrains.intellij.deps.fastutil:intellij-deps-fastutil"))
compileOnly(jpsModel()) compileOnly(jpsModel())
compileOnly(jpsModelImpl())
compileOnly(jpsBuild()) compileOnly(jpsBuild())
compileOnly(jpsModelSerialization()) compileOnly(jpsModelSerialization())
testApi(jpsModel()) testRuntimeOnly(jpsModel())
// testFramework includes too many unnecessary dependencies. Here we manually list all we need to successfully run JPS tests // testFramework includes too many unnecessary dependencies. Here we manually list all we need to successfully run JPS tests
testApi(testFramework()) { isTransitive = false } testImplementation(testFramework()) { isTransitive = false }
testApi("com.jetbrains.intellij.platform:test-framework-core:$intellijVersion") { isTransitive = false } testImplementation("com.jetbrains.intellij.platform:test-framework-core:$intellijVersion") { isTransitive = false }
testRuntimeOnly("com.jetbrains.intellij.platform:analysis-impl:$intellijVersion") { isTransitive = false } testRuntimeOnly("com.jetbrains.intellij.platform:analysis-impl:$intellijVersion") { isTransitive = false }
testRuntimeOnly("com.jetbrains.intellij.platform:boot:$intellijVersion") { isTransitive = false } testRuntimeOnly("com.jetbrains.intellij.platform:boot:$intellijVersion") { isTransitive = false }
testRuntimeOnly("com.jetbrains.intellij.platform:analysis:$intellijVersion") { isTransitive = false } testRuntimeOnly("com.jetbrains.intellij.platform:analysis:$intellijVersion") { isTransitive = false }
@@ -55,29 +52,20 @@ dependencies {
testRuntimeOnly("com.jetbrains.intellij.platform:lang:$intellijVersion") { isTransitive = false } testRuntimeOnly("com.jetbrains.intellij.platform:lang:$intellijVersion") { isTransitive = false }
testRuntimeOnly("com.jetbrains.intellij.platform:lang-impl:$intellijVersion") { isTransitive = false } testRuntimeOnly("com.jetbrains.intellij.platform:lang-impl:$intellijVersion") { isTransitive = false }
testRuntimeOnly("com.jetbrains.intellij.platform:util-ex:$intellijVersion") { isTransitive = false } testRuntimeOnly("com.jetbrains.intellij.platform:util-ex:$intellijVersion") { isTransitive = false }
testRuntimeOnly("com.google.code.gson:gson:2.8.9")
testCompileOnly(project(":kotlin-reflect-api")) testCompileOnly(project(":kotlin-reflect-api"))
testApi(project(":compiler:incremental-compilation-impl")) testImplementation(projectTests(":compiler:incremental-compilation-impl"))
testApi(projectTests(":compiler:tests-common"))
testApi(projectTests(":compiler:incremental-compilation-impl"))
testApi(commonDependency("junit:junit"))
testApi(project(":kotlin-test:kotlin-test-jvm"))
testApi(projectTests(":kotlin-build-common"))
testApi(projectTests(":compiler:test-infrastructure-utils"))
testCompileOnly(jpsBuild()) testCompileOnly(jpsBuild())
testApi(devKitJps()) { testImplementation(devKitJps()) {
exclude(group = "com.google.code.gson", module = "gson") // Workaround for Gradle dependency resolution error exclude(group = "com.google.code.gson", module = "gson") // Workaround for Gradle dependency resolution error
} }
implementation("com.google.code.gson:gson:2.8.9") // Workaround for Gradle dependency resolution error
testApi(jpsBuildTest()) testImplementation(jpsBuildTest())
compilerModules.forEach { compilerModules.forEach {
testRuntimeOnly(project(it)) testRuntimeOnly(project(it))
} }
testRuntimeOnly(toolsJar())
testRuntimeOnly(project(":kotlin-reflect"))
testRuntimeOnly(project(":kotlin-script-runtime"))
testImplementation("org.projectlombok:lombok:1.18.16") testImplementation("org.projectlombok:lombok:1.18.16")
} }