Skip to content

Commit 550de64

Browse files
committed
Set status attribute to "release" for built modules
If `org.gradle.status` is unspecified in a Gradle module, Gradle will read it as "integration". This is a problem, because in the event of a version conflict, Gradle will always prefer the "release" status. Consider this example: - "1.21.11-61.0.1" uses "release" - "1.21.11-61.0.2" uses "integration" Gradle's version parser doesn't understand version numbers with multiple versions in them, so it treats the Forge version as a qualifier. In this case, 61.0.1 always wins since it is marked as a "release" version.
1 parent 78a6020 commit 550de64

File tree

1 file changed

+5
-1
lines changed
  • src/main/java/net/minecraftforge/mcmaven/impl/repo

1 file changed

+5
-1
lines changed

src/main/java/net/minecraftforge/mcmaven/impl/repo/Repo.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ protected static PendingArtifact pending(String message, Task task, Artifact art
6666
protected Supplier<GradleModule.Variant[]> sourceVariant(Mappings mappings) {
6767
return () -> new GradleModule.Variant[] {
6868
GradleModule.Variant.of("sources")
69+
.attribute("org.gradle.status", "release")
6970
.attribute("org.gradle.usage", "java-runtime")
7071
.attribute("org.gradle.category", "documentation")
7172
.attribute("org.gradle.dependency.bundling", "external")
@@ -79,6 +80,7 @@ protected Supplier<GradleModule.Variant[]> sourceVariant(Mappings mappings) {
7980
protected Supplier<GradleModule.Variant[]> metadataVariant() {
8081
return () -> new GradleModule.Variant[] {
8182
GradleModule.Variant.of("metadata")
83+
.attribute("org.gradle.status", "release")
8284
.attribute("org.gradle.usage", "metadata")
8385
};
8486
}
@@ -102,6 +104,7 @@ protected Supplier<GradleModule.Variant[]> simpleVariant(String name, Mappings m
102104
return () -> new GradleModule.Variant[] {
103105
GradleModule.Variant
104106
.of(name)
107+
.attribute("org.gradle.status", "release")
105108
.attribute("org.gradle.category", "library")
106109
.attribute("org.gradle.libraryelements", "jar")
107110
.attribute(Mappings.CHANNEL_ATTR, mappings.channel())
@@ -148,7 +151,8 @@ protected GradleModule.Variant[] classVariants(Mappings mappings, MCPSide side,
148151
);
149152

150153
Consumer<GradleModule.Variant> common = v -> {
151-
v.attribute("org.gradle.usage", "java-runtime")
154+
v.attribute("org.gradle.status", "release")
155+
.attribute("org.gradle.usage", "java-runtime")
152156
.attribute("org.gradle.category", "library")
153157
.attribute("org.gradle.dependency.bundling", "external")
154158
.attribute("org.gradle.libraryelements", "jar")

0 commit comments

Comments
 (0)