From f77586574fa538e9f91096f72b6d105756d61830 Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Mon, 22 Jan 2018 16:15:29 +0300 Subject: [PATCH] Always sort files in K2JSCompiler Previously files were sorted only when IncrementalDataProvider was not null to normalize js output in case of incremental compilation. Because of that an output js file could be different after rebuild in IC tests. The issue could be reproduced anywhere, but the tests failed only on Windows, and it seems tests were not run on Windows for some time. --- compiler/cli/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/cli/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java b/compiler/cli/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java index 98a676f1796..f61a830ea0d 100644 --- a/compiler/cli/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java +++ b/compiler/cli/src/org/jetbrains/kotlin/cli/js/K2JSCompiler.java @@ -146,6 +146,7 @@ public class K2JSCompiler extends CLICompiler { return translator.translateUnits(reporter, translationUnits, mainCallParameters, jsAnalysisResult); } + CollectionsKt.sortBy(allKotlinFiles, ktFile -> VfsUtilCore.virtualToIoFile(ktFile.getVirtualFile())); return translator.translate(reporter, allKotlinFiles, mainCallParameters, jsAnalysisResult); }