Make it possible to attach community version of kotlin-ide
This commit is contained in:
committed by
teamcityserver
parent
8ac5d03f02
commit
c954fa4900
@@ -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")
|
||||
+4
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user