Make it possible to attach community version of kotlin-ide

This commit is contained in:
Nikita Bobko
2021-06-14 18:07:23 +02:00
committed by teamcityserver
parent 8ac5d03f02
commit c954fa4900
2 changed files with 8 additions and 3 deletions
+4 -1
View File
@@ -86,4 +86,7 @@ val Project.isConfigurationCacheDisabled
get() = (gradle.startParameter as? org.gradle.api.internal.StartParameterInternal)?.isConfigurationCache != true
val Project.isIdeaActive
get() = providers.systemProperty("idea.active").forUseAtConfigurationTime().isPresent
get() = providers.systemProperty("idea.active").forUseAtConfigurationTime().isPresent
val Project.intellijCommunityDir: File
get() = rootDir.resolve("kotlin-ide/intellij/community").takeIf { it.isDirectory } ?: rootDir.resolve("kotlin-ide/intellij")
@@ -102,10 +102,12 @@ fun convertJpsLibrary(lib: JpsLibrary, scope: JpsJavaDependencyScope, exported:
return when {
mavenRepositoryLibraryDescriptor == null -> {
lib.getRootUrls(JpsOrderRootType.COMPILED)
.map { File(it.removePrefix("jar://").removeSuffix("!/")).relativeTo(KOTLIN_REPO_ROOT) }
.map { it.removePrefix("jar://").removeSuffix("!/").removePrefix(KOTLIN_REPO_ROOT.canonicalPath) }
.map {
check(it.startsWith("/kotlin-ide/intellij/")) { "Only jars from Community repo are accepted $it" }
val relativeToCommunity = it.removePrefix("/kotlin-ide/intellij/").removePrefix("community/")
JpsLikeJarDependency(
"files(rootDir.resolve(\"$it\").canonicalPath)",
"files(intellijCommunityDir.resolve(\"$relativeToCommunity\").canonicalPath)",
scope,
dependencyConfiguration = null,
exported = exported