Skip to content

Commit

Permalink
Ensure test cluster classpath inputs have predictable ordering (#43938)
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira authored Jul 3, 2019
1 parent c0d5bec commit baabb75
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -880,6 +881,7 @@ private List<File> getInstalledFileSet(Action<? super PatternFilterable> filter)
// https://docs.gradle.org/nightly/release-notes.html#improved-handling-of-zip-archives-on-classpaths
.map(zipFile -> project.zipTree(zipFile).matching(filter))
.flatMap(tree -> tree.getFiles().stream())
.sorted(Comparator.comparing(File::getName))
.collect(Collectors.toList());
}

Expand All @@ -901,8 +903,13 @@ private List<File> getInstalledFiles() {
}

@Classpath
private Set<File> getDistributionClasspath() {
return project.fileTree(getExtractedDistributionDir()).matching(filter -> filter.include("**/*.jar")).getFiles();
private List<File> getDistributionClasspath() {
ArrayList<File> files = new ArrayList<>(project.fileTree(getExtractedDistributionDir())
.matching(filter -> filter.include("**/*.jar"))
.getFiles());
files.sort(Comparator.comparing(File::getName));

return files;
}

@InputFiles
Expand Down

0 comments on commit baabb75

Please sign in to comment.