-
-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publishing extended Gradle Module Metadata for Tooling #959
base: 1.20.x
Are you sure you want to change the base?
Conversation
Last commit published: 636279f873ec8796307dde98a767fd6ae126b287. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #959' // https://github.com/neoforged/NeoForge/pull/959
url 'https://prmaven.neoforged.net/NeoForge/pr959'
content {
includeModule('net.neoforged', 'neoforge')
includeModule('net.neoforged', 'testframework')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr959
cd NeoForge-pr959
curl -L https://prmaven.neoforged.net/NeoForge/pr959/net/neoforged/neoforge/20.6.104-beta-pr-959-features-gradle-metadata/mdk-pr959.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip To test a production environment, you can download the installer from here. |
canBeResolved = false | ||
canBeConsumed = true | ||
attributes { | ||
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, "installer")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The installer is, in gradle-land, probably still considered a LIBRARY
-- it's a jar with classes in it. It just happens to have Bundling.EMBEDDED
. A library is generally "a binary and a set of dependencies" -- gradle probably could have better called them "binaries and/or dependencies of binaries" to be honest
// Publish it | ||
javaComponent.addVariantsFromConfiguration(it) {} | ||
} | ||
universalJar { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone does implementation 'net.neoforged:neoforge:x.y.z'
, they will end up with the universal jar. This doesn't make much sense and leads to confusion; a straight dependency on neoforged in this way should probably fail to resolve if nothing else is specified and no plugin is present. Maybe give this variant a capability?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We tried that once already and at that point at least it did simply resolve to an empty set of files. We can try again, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It will never resolve to an empty set of files, it has to pick a variant. If I had to guess it picked a variant due to a partial match or something - you have to make variants explicitly not match, not just be incomplete matches, because gradle considers any missing attributes to be matches. I'll give it a poke if I have a chance
0159a46
to
913506c
Compare
Changelog and classifiers Add publications Publish all moddev artifacts using capabilities Publishing... stuff... Add mavens for PRs Use published neoform version Use published neoform version
913506c
to
fc8c8d0
Compare
No description provided.