Skip to content

Commit 5bfac89

Browse files
committed
Use a stable order for the mergeJar path input
1 parent eb893f1 commit 5bfac89

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/main/java/org/gradlex/javamodule/moduleinfo/ExtraJavaModuleInfoPlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ private static class IdExtractor implements Transformer<List<String>, Collection
307307
@Override
308308
public List<String> transform(Collection<ResolvedArtifactResult> artifacts) {
309309
return artifacts.stream()
310+
.sorted(Comparator.comparing(ResolvedArtifactResult::getFile))
310311
.map(a -> {
311312
ComponentIdentifier componentIdentifier = a.getId().getComponentIdentifier();
312313
if (componentIdentifier instanceof ModuleComponentIdentifier) {
@@ -332,6 +333,7 @@ public FileExtractor(ProjectLayout projectLayout) {
332333
public List<RegularFile> transform(Collection<ResolvedArtifactResult> artifacts) {
333334
Directory projectDirectory = projectLayout.getProjectDirectory();
334335
return artifacts.stream()
336+
.sorted(Comparator.comparing(ResolvedArtifactResult::getFile))
335337
.map(a -> projectDirectory.file(a.getFile().getAbsolutePath()))
336338
.collect(Collectors.toList());
337339
}

0 commit comments

Comments
 (0)