From 35dc57d67498c6fd05e96023b6fc91e2b07bd026 Mon Sep 17 00:00:00 2001 From: Vyacheslav Gerasimov Date: Fri, 6 Mar 2020 01:22:52 +0300 Subject: [PATCH] Build: Sort idea files in ivy repository to stabilize order Sort by lowercase name, otherwise order may be different on win --- buildSrc/prepare-deps/build.gradle.kts | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/buildSrc/prepare-deps/build.gradle.kts b/buildSrc/prepare-deps/build.gradle.kts index c53b0b146b6..5461536c136 100644 --- a/buildSrc/prepare-deps/build.gradle.kts +++ b/buildSrc/prepare-deps/build.gradle.kts @@ -402,16 +402,19 @@ fun writeIvyXml( } element("publications") { - artifactDir.listFiles()?.filter(::shouldIncludeIntellijJar)?.forEach { jarFile -> - val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar") - emptyElement("artifact") { - attributes( - "name" to relativeName, - "type" to "jar", - "ext" to "jar", - "conf" to "default" - ) - } + artifactDir.listFiles() + ?.filter(::shouldIncludeIntellijJar) + ?.sortedBy { it.name.toLowerCase() } + ?.forEach { jarFile -> + val relativeName = jarFile.toRelativeString(baseDir).removeSuffix(".jar") + emptyElement("artifact") { + attributes( + "name" to relativeName, + "type" to "jar", + "ext" to "jar", + "conf" to "default" + ) + } } sourcesJar.forEach { jarFile ->