mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[jps-to-bazel] Use project library name if non-repository in DependencyKt#generateDeps (IJI-3419)
GitOrigin-RevId: 6573561268bb246594fe0187f6e85073ff8c30c9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5d6761c267
commit
2399761dba
@@ -185,13 +185,21 @@ internal fun generateDeps(
|
||||
val isCommunityLib = firstFile.startsWith(context.communityRoot)
|
||||
val libraryContainer = context.getLibraryContainer(isCommunityLib)
|
||||
|
||||
val isModuleLibrary = element.libraryReference.parentReference is JpsModuleReference
|
||||
val targetName = if (underKotlinSnapshotLibRoot(firstFile, communityRoot = context.communityRoot)) {
|
||||
// name the same way as a maven library, so there will be minimal changes
|
||||
// migrating from kotlin from maven to kotlin from a snapshot
|
||||
escapeBazelLabel(jpsLibrary.name)
|
||||
}
|
||||
else if (isModuleLibrary) {
|
||||
val moduleRef = element.libraryReference.parentReference as JpsModuleReference
|
||||
val name = jpsLibrary.name.takeIf { !it.startsWith("#") && it.isNotEmpty() } ?: firstFile.nameWithoutExtension
|
||||
camelToSnakeCase(escapeBazelLabel("${moduleRef.moduleName.removePrefix("intellij.")}-${name}"))
|
||||
}
|
||||
else {
|
||||
camelToSnakeCase(escapeBazelLabel(firstFile.nameWithoutExtension))
|
||||
// name the same way as the project library,
|
||||
// otherwise hibernate-3.6.10 and hibernate-4.1.3 will use the same identity dom4j-1-6-1 thus only one of them will be added to projectLibraries
|
||||
camelToSnakeCase(escapeBazelLabel(jpsLibrary.name))
|
||||
}
|
||||
|
||||
val libraryTarget = LibraryTarget(
|
||||
|
||||
Reference in New Issue
Block a user