mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-06 11:50:54 +07:00
Fix filtering for dotnet icons json generator
GitOrigin-RevId: 74c5a8969c4fd1cee4a66c7f604918ceab565cce
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b300b7c1ec
commit
e0429b6ff7
@@ -23,13 +23,15 @@ object RiderIconsJsonGenerator {
|
||||
|
||||
data class ExpuiItem(val expuiFile: Path, val originFile: Path)
|
||||
|
||||
val postfixSymbols = listOf('@', '_')
|
||||
val expuiItems = expuiFolders.flatMap { folder ->
|
||||
folder.walkTopDown()
|
||||
.filter { it.isFile && it.extension.lowercase() == "svg" }
|
||||
.groupBy { g -> g.name.takeWhile { c -> c.isLetter() } }
|
||||
.map { g ->
|
||||
g.value.first { it.nameWithoutExtension == g.key }
|
||||
.let { ExpuiItem(it.toPath(), folder.parentFile.resolve(it.relativeTo(folder)).toPath()) }
|
||||
.groupBy { g -> g.nameWithoutExtension.takeWhile { c -> !postfixSymbols.contains(c) } }
|
||||
.map { g -> // We want to know if there is file with postfix which does not have main file
|
||||
g.value.firstOrNull { it.nameWithoutExtension == g.key }
|
||||
?.let { ExpuiItem(it.toPath(), folder.parentFile.resolve(it.relativeTo(folder)).toPath()) }
|
||||
?: error("Can't find file without postfix with name ${g.key} among files: [${g.value.joinToString(", ") { it.path }}]")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user