Apache Solr open-source search software
Tolerate comments in versions.props (#1537)
Jan Høydahl104e069b3bb4
diff --git a/gradle/validation/versions-props-sorted.gradle b/gradle/validation/versions-props-sorted.gradleindex 670d2e8f691..3282faf8391 100644--- a/gradle/validation/versions-props-sorted.gradle+++ b/gradle/validation/versions-props-sorted.gradle@@ -17,17 +17,18 @@// This ensures 'versions.props' file is sorted lexicographically.+import java.util.stream.Collectors+configure(rootProject) {task versionsPropsAreSorted() {doFirst {def versionsProps = file('versions.props')- def lines = versionsProps.readLines("UTF-8")+ // remove # commented lines and blank lines+ def lines = versionsProps.readLines("UTF-8").stream().filter(l -> !l.matches(/^(#.*|\s*)$/)).collect(Collectors.toList())def sorted = lines.toSorted()if (!Objects.equals(lines, sorted)) {- def sortedFile = file("${buildDir}/versions.props")- sortedFile.write(sorted.join("\n"), "UTF-8")- throw new GradleException("${versionsProps} file is not sorted lexicographically. I wrote a sorted file to ${sortedFile} - please review and commit.")+ throw new GradleException("${versionsProps} file is not sorted lexicographically.")}}}diff --git a/versions.props b/versions.propsindex 68fa9be55b5..8c15fc3ef64 100644--- a/versions.props+++ b/versions.props@@ -1,3 +1,5 @@+# The lines in this file needs to be lexicographically sorted.+# Please only add direct dependencies. Overrides of transitive versions should be called out in a comment.biz.aQute.bnd:biz.aQute.bnd.annotation=6.4.0com.adobe.testing:s3mock-junit4=2.1.34com.carrotsearch.randomizedtesting:*=2.8.1