From e4df26d9091bed47848378c638b4c719200c6c15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20L=C3=A4ubrich?= Date: Mon, 29 Jan 2024 20:44:48 +0100 Subject: [PATCH] Sort input sources by name --- .../main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java index 5ef9838584..5fc0b9cef3 100644 --- a/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java +++ b/tycho-compiler-jdt/src/main/java/org/eclipse/tycho/compiler/jdt/JDTCompiler.java @@ -110,6 +110,9 @@ public CompilerResult performCompile(CompilerConfiguration config) throws Compil if (sourceFiles.length == 0) { return new CompilerResult(); } + //even though order of java sources should not matter, it can make a difference sometimes (e.g. lamda numbering) see https://github.com/eclipse-jdt/eclipse.jdt.core/issues/1921 + //so to have always the same arguments regardless of hash table ordering that is used internally by plexus compiler we sort the files simply by name + Arrays.sort(sourceFiles); logger.info("Compiling " + sourceFiles.length + " " + "source file" + (sourceFiles.length == 1 ? "" : "s") + " to " + destinationDir.getAbsolutePath() + " using " + COMPILER_NAME + "");