From 2a44ff532ee715349523355eda97bd1ed589d11f Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Sat, 18 Dec 2021 21:17:56 +0100 Subject: [PATCH] LUCENE-10308: sort input files for ecj so that module-info.java comes first. --- gradle/validation/ecj-lint.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gradle/validation/ecj-lint.gradle b/gradle/validation/ecj-lint.gradle index 4ad97fc4c71..591eb8464e0 100644 --- a/gradle/validation/ecj-lint.gradle +++ b/gradle/validation/ecj-lint.gradle @@ -73,6 +73,10 @@ allprojects { srcDirs.collectMany { dir -> project.fileTree(dir: dir, include: "**/*.java" ).files } + // Try to sort all input files; a side-effect of this should be that module-info.java + // is placed first on the list, which works around ECJ bug: + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=569833 + .sort() .collect {file -> escapeFileName(file.absolutePath.toString())}.join("\n"), "UTF-8") args += [ "-d", "none" ]