ForgeGradle icon indicating copy to clipboard operation
ForgeGradle copied to clipboard

[FG7] Add a way to configure Tools (Mavenizer/Slimelauncher)

Open RealMangorage opened this issue 10 months ago • 2 comments

This is mainly a PR to discuss the most ideal way of handling the configurability of these tools that FG7 uses.

The build script would look like this, to override a tool.

dependencies {
    mavenizer "net.minecraftforge:minecraft-mavenizer:0.3.3"
    slimelauncher "net.minecraftforge:slime-launcher:0.1.0"

    implementation(minecraft.dep("net.minecraftforge:forge:1.21.5-55.0.23"))
}

RealMangorage avatar Jun 17 '25 05:06 RealMangorage

There are a couple of things about your implementation I don't like. But with regards to what we want to add, I do like this.

Originally, I was planning something like this:

minecraft {
    mavenizer = 'me.jonathing:mavenizer:0.3.0'
}

But this works better. I do think I need to clean up a bit of my code with the Tools enum, it's not entirely finished.

Jonathing avatar Jun 17 '25 22:06 Jonathing

I did it this way, as to not change any method signatures, just add new ones, as I was not entirely sure how you wanted to deal with it.

I can go thru everything (my impl) and clean it up for you, if you would like to.

RealMangorage avatar Jun 17 '25 22:06 RealMangorage

Closing because I added an experimental API that allows for this. The implementation details have yet to be finalized, but it works like this:

fgtools {
    configure('mavenizer') {
        classpath = configurations.detachedConfiguration(
            dependencies.create('net.minecraftforge:minecraft-mavenizer:0.3.22')
        )
    }
}

classpath in this case is a ConfigurableFileCollection. I will not add helper methods for things like String artifacts because this is meant for advanced users only.

Jonathing avatar Oct 06 '25 17:10 Jonathing