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
@@ -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