Conversation
PaintNinja
left a comment
There was a problem hiding this comment.
Thanks, a bit clearer how to reobf in FG7 now. Left a bunch of comments - some minor stuff, some more significant questions.
| // This is generated by mavenizer, this is `net.minecraft:mappings_{channel}:{minecraft}-{mcp}:map2srg@tsrg.gz` | ||
| // I intend to both publish these as public artifacts on the Forge maven, and expose a FG helper to make you not need to find the MCP version | ||
| // Parchment is official mappings, just with parameters, so you can use official. | ||
| mappings('net.minecraft:mappings_official:1.21.10-20251007.101210:map2srg@tsrg.gz') |
There was a problem hiding this comment.
Where can users find the MCP timestamp found in this artifact string?
There was a problem hiding this comment.
With my changes to FG, this information is now exposed via FG. I'm updating the example right now to show it.
We should probably build a matrix of exact MCP Versions for each forge version. For documentation. Until that happens, it is typically the latest version listed on MCPConfig's index.
obfuscation/fg7/build.gradle
Outdated
| implementation minecraft.dependency('net.minecraftforge:forge:1.21.10-60.0.17') | ||
| } | ||
|
|
||
| renamer.classes(jar) { |
There was a problem hiding this comment.
How does one register multiple reobf jar tasks for different inputs?
tasks.register('reobfJar', RenameJar) {
// ?
}Is renamer.classes(...) { ... } a helper for task registration or required for it to work? If the former and not much more verbose, I'd prefer knowing the standard Gradle way for registering the task.
There was a problem hiding this comment.
The sources function accepts a name as the first parameter
So to create a second task you can do:
renamer.classes('renameApiJar', apiJar) or renamer.classes(apiJar). Both will create the 'renameApiJar' task.
It is a helper that replaces:
def target = jar
tasks.register('rename' + target.name.capitalize, net.minecraftforge.renamer.gradle.RenameJar) {
from target
}I am adamantly against having modders import custom classes in their buildscript, but if you want to do it in your own you can. But it is not recommended as we're intending to add a sources variant that applies Srg2Source for you.
Eventually it will also add helpers for generating publish artifacts with the correct marker attributes denoting what name they are in. But that was pushed to a later date as its not important right now.
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
Co-authored-by: Paint_Ninja <PaintNinja@users.noreply.github.com>
Simple example of using the renamer plugin to build a obfusicated jar.
Addresses #3
Two main concerns I wanted to bounce of @Jonathing
So basically, FG needs to make a couple helpers to get the mappings artifacts.
Not super critical, FD7 is the primary, but I think something like the Files object you're doing for that is probably something we could pull for this as well.