mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[kotlin] project-model-updater: prettify libraries regeneration
To reduce noice and prepare for up-to-date check (KTIJ-35768) ^KTIJ-35777 GitOrigin-RevId: ea7d71f7901cc19462b5d4c0ffbb80bda34e0dc8
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f56180cada
commit
5b9b2fc3e0
+16
-7
@@ -100,19 +100,28 @@ fun main(args: Array<String>) {
|
||||
updateCoopRunConfiguration(monorepoRoot, communityRoot)
|
||||
}
|
||||
|
||||
private fun regenerateProjectLibraries(dotIdea: Path, libraries: List<JpsLibrary>, resolverSettings: JpsResolverSettings) {
|
||||
private fun regenerateProjectLibraries(dotIdea: Path, newLibraries: List<JpsLibrary>, resolverSettings: JpsResolverSettings) {
|
||||
val librariesDir = dotIdea.resolve("libraries")
|
||||
for (it in librariesDir.listDirectoryEntries("kotlinc_*")) {
|
||||
println("Removing $it")
|
||||
it.deleteIfExists()
|
||||
}
|
||||
val oldLibraries = librariesDir.listDirectoryEntries("kotlinc_*").toMutableSet()
|
||||
|
||||
for (library in libraries) {
|
||||
for (library in newLibraries) {
|
||||
val libraryFileName = library.name.replace("\\W".toRegex(), "_") + ".xml"
|
||||
val xmlFile = librariesDir.resolve(libraryFileName)
|
||||
println("Writing $xmlFile")
|
||||
val isRegeneration = oldLibraries.remove(xmlFile)
|
||||
if (isRegeneration) {
|
||||
println("Rewriting $xmlFile")
|
||||
} else {
|
||||
println("Writing $xmlFile")
|
||||
}
|
||||
|
||||
xmlFile.writeText(library.render(resolverSettings))
|
||||
}
|
||||
|
||||
// Drop redundant libraries
|
||||
for (redundantLibrary in oldLibraries) {
|
||||
println("Removing $redundantLibrary")
|
||||
redundantLibrary.deleteExisting()
|
||||
}
|
||||
}
|
||||
|
||||
private fun updateCoopRunConfiguration(monorepoRoot: Path?, communityRoot: Path) {
|
||||
|
||||
Reference in New Issue
Block a user