-
-
Notifications
You must be signed in to change notification settings - Fork 9
3.4 - Shared Tools Rework #26
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
3.4 - Shared Tools Rework #26
Conversation
|
|
||
| //region Dependency Information | ||
|
|
||
| public record SimpleModuleIdentifier(String getGroup, String getName) implements ModuleIdentifier { |
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.
My be worth stealing this its tried and tested.
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.
artifact-utils :P
|
Alright, so quick pass, lots of changes and class shuffleing around but looks fine to me. Also currently we have: fgtools {
configure('mavenizer') {
classpath = configurations.detachedConfiguration(dependencies.create('net.minecraftforge:minecraft-mavenizer:0.4.19'))
}
}Preferribly we would be able to do: fgtools {
configure('mavenizer') {
version = '2.0'
// Ideally this would allow for setting any of the variables, extension, classifier, url, java verion
}
}Or, if possible: fgtools {
mavenizer.version = '2.0'
}As 'use the same exact tool, but with a updated version, would be the number one use case. As for the ToolExec task (this is just reiterating what we've already talk about) |
While it makes sense on paper, I'm not seeing why this would be necessary. The logic you wrote in MinecraftForge/ForgeAutoRenamingTool#32 makes it look for |
|
Well you beed to not error when there isnt a main class. And i thought it only looked for a main class when passed in the classpath as -jar not as -cp. Either way if it works it works. |
|
JavaExec silently translates the execution call, yes. See JavaExecSpec#getMainClass. |
|
Pushed my changes to allow for users to do: renamerTools {
configure('mavenizer') {
version = '2.0' // results in net.minecraftforge:minecraft-mavenizer:2.0
artifact = 'some.other:tool:1.0' // this will be used before version is, so only specify one.
}
}You can still specify the full classpath, which will override all of this, but for the average use case. This is far easier then setting the configurations. Because the intended use of shared is to be shaded in, I dont think there is a sane way to share the same "tools" extension. So we can set that as a future goal. For now each plugin have its own tools extension is fine. I have opted to not care about adding a helper for setting the java version: renamerTools {
configure('mavenizer') {
javaVersion = 21
}
}the current version is a little verbose but good enough for now: renamerTools {
configure('mavenizer') {
javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(21)
}
}
} |
This is mostly a GradleUtils Shared change, but was large enough to warrant a minor version bump. This also includes some deprecations and (binary compatible) structural changes to GradleUtils itself. Co-authored-by: LexManos <LexManos@gmail.com>
ad7b957 to
6c1203a
Compare
|
Splitting |
This is mostly a GradleUtils Shared change, but was large enough to warrant a minor version bump. This also includes some deprecations and (binary compatible) structural changes to GradleUtils itself. Co-authored-by: LexManos <LexManos@gmail.com>
This is mostly a GradleUtils Shared change, but was large enough to warrant a minor version bump. This also includes some deprecations and (binary compatible) structural changes to GradleUtils itself. Co-authored-by: LexManos <LexManos@gmail.com>
This PR marks the start of GradleUtils 3.4.0, with the main change being a rework to the Tools system provided by GradleUtils shared. Specifically, the ability to define a tool through it's maven coordinate as opposed to a hard-coded download URL. This also includes an attempt to try and download the tool through Gradle before falling back to trying the Forge Maven (or whatever Maven URL was passed in as the tool's Maven URL).
There are also some additional changes and cleanup to the main plugin, but the main plugin remains binary compatible. As a reminder, binary breaking changes to GradleUtils Shared are fair game no matter the version number, as GradleUtils Shared must always be shadowed and relocated by the consuming plugin.