diff --git a/buildSrc/src/main/kotlin/artifacts.kt b/buildSrc/src/main/kotlin/artifacts.kt index fb5645b203f..bc5116b0fbc 100644 --- a/buildSrc/src/main/kotlin/artifacts.kt +++ b/buildSrc/src/main/kotlin/artifacts.kt @@ -240,6 +240,11 @@ fun Project.publishJarsForIde(projects: List, libraryDependencies: List< idePluginDependency { publishProjectJars(projects, libraryDependencies) } + configurations.all { + // Don't allow `ideaIC` from compiler to leak into Kotlin plugin modules. Compiler and + // plugin may depend on different versions of IDEA and it will lead to version conflict + exclude(module = ideModuleName()) + } dependencies { projects.forEach { jpsLikeJarDependency(project(it), JpsDepScope.COMPILE, { isTransitive = false }, exported = true) @@ -254,6 +259,11 @@ fun Project.publishTestJarsForIde(projectNames: List) { idePluginDependency { publishTestJar(projectNames) } + configurations.all { + // Don't allow `ideaIC` from compiler to leak into Kotlin plugin modules. Compiler and + // plugin may depend on different versions of IDEA and it will lead to version conflict + exclude(module = ideModuleName()) + } dependencies { for (projectName in projectNames) { jpsLikeJarDependency(projectTests(projectName), JpsDepScope.COMPILE, exported = true) diff --git a/buildSrc/src/main/kotlin/localDependencies.kt b/buildSrc/src/main/kotlin/localDependencies.kt index e5d97c5939c..0cbe5f6b531 100644 --- a/buildSrc/src/main/kotlin/localDependencies.kt +++ b/buildSrc/src/main/kotlin/localDependencies.kt @@ -35,7 +35,7 @@ private fun Project.kotlinBuildLocalDependenciesDir(): File = private fun Project.kotlinBuildLocalRepoDir(): File = kotlinBuildLocalDependenciesDir().resolve("repo") -private fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) { +fun Project.ideModuleName() = when (IdeVersionConfigurator.currentIde.kind) { Ide.Kind.AndroidStudio -> "android-studio-ide" Ide.Kind.IntelliJ -> { if (kotlinBuildProperties.intellijUltimateEnabled) "ideaIU" else "ideaIC"