MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
526 stars 446 forks source link

Add overload for fg.deobf to support version catalogs & variantOf declarations #951

Closed KitsuneAlex closed 2 months ago

KitsuneAlex commented 2 months ago

This PR introduces a new overload for the deobf() function to allow for smoother Gradle KTS integration; this allows to do the following in Gradle KTS:

dependencies {
    implementation(fg.deobf(libs.someLib))
    implementation(fg.deobf(variantOf(libs.someLib) { classifier("api") }))
}

This is way cleaner than converting to strings in-between.

LexManos commented 2 months ago

Best bet is to not do these grouped PRs. As the deobf change is fine, but its blocked by all the other changes.

KitsuneAlex commented 2 months ago

Best bet is to not do these grouped PRs. As the deobf change is fine, but its blocked by all the other changes.

Didn't know there would be so many issues with this ^^

KitsuneAlex commented 2 months ago

Please update your PR description to reflect the shift in direction it has received.

Sure :)

KitsuneAlex commented 2 months ago

This seems to cause some issues with certain dependency configurations because MinimalExternalDeps are immutable. I'll fix the issue really quick! ^^

KitsuneAlex commented 2 months ago

That seems to work nicely, just internally converting into the required four-segment dependency notation when a DependencyVariant is passed into deobf().

KitsuneAlex commented 2 months ago

I'm going to reopen this from a different source branch in a bit, cleaning up my local repository.