Skip to content

Commit b31b444

Browse files
authored
Use a stable order for the mergeJar path input (#227)
1 parent eb893f1 commit b31b444

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Extra Java Module Info Gradle Plugin - Changelog
22

3-
## Version 1.13.2
3+
## Version 1.14
44
* [Fixed] [#179](https://github.com/gradlex-org/extra-java-module-info/issues/179) - Combine 'preserveExisting' and 'exports'
55
* [Fixed] [#219](https://github.com/gradlex-org/extra-java-module-info/issues/219) - Combine 'preserveExisting' and 'removePackage'
66
* [Fixed] [#223](https://github.com/gradlex-org/extra-java-module-info/issues/223) - Combine 'preserveExisting' and 'ignoreServiceProvider'
7+
* [Fixed] [#227](https://github.com/gradlex-org/extra-java-module-info/issues/227) - Stable order for the mergeJar path input
78

89
## Version 1.13.1
910
* [Fixed] [#197](https://github.com/gradlex-org/extra-java-module-info/issues/197) - Slightly adjust Gradle API usage for better 9.0.0 compatibility

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,11 @@ val mainRuntimeClasspath = configurations.create("mainRuntimeClasspath") {
253253
// depend on all subprojects to create a dependency graph with "everything"
254254
dependencies { mainRuntimeClasspath(project(":app")) }
255255

256+
// If the mergeJar feature is used, also use the "global classpath" to discover jars-to-merge (optional)
257+
configurations.getByName("javaModulesMergeJars") {
258+
extendsFrom(configurations.getByName("mainRuntimeClasspath"))
259+
}
260+
256261
// Use the global classpath for consisten resolution (optional)
257262
configurations.runtimeClasspath {
258263
shouldResolveConsistentlyWith(mainRuntimeClasspath)

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)