MinecraftForge / ForgeGradle

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

Update to Gradle 4.6 / Resolve compatibility issues with future Gradle versions #493

Closed carif closed 6 years ago

carif commented 6 years ago

As it seems that a lot of incompatibilities with newer Gradle versions pop up over time, I'm wondering why ForgeGradle isn't updating to a newer version of Gradle?

When using newer Gradle versions like 4.6, Gradle will also throw out these warnings:

Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0.
See https://docs.gradle.org/4.6/userguide/command_line_interface.html#sec:command_line_warnings

A more precise output for example:

> Task :compileJava
Putting annotation processors on the compile classpath has been deprecated and is scheduled to be removed in Gradle 5.0. Please add them to the processor path instead. If these processors were unintentionally leaked on the compile classpath, use the -proc:none compiler option to ignore them..
LexManos commented 6 years ago

Because we have to keep compatibility with older versions of gradle. And there is no real benifit of updating to higher versions. As for the specific warning you've specified, as far as I know we don't add an annotation processors as that system is a hacky system. So its something you've added to your classpath or some weird unknown feature of a MC dep.

carif commented 6 years ago

@LexManos I'm wondering why compatibility has to be kept with older gradle versions? I guess besides speed improvements Java 9 and native JUnit 5 support would be the only benefit when the time comes when Forge and Minecraft support Java 9. Thought it would eventually help maintaining this project as only a few Gradle versions need to be supportet and not so many like currently.

Well, I don't really know what an annotation processors is in Gradle, thought after a quick Google search I couldn't find anything within my build script which might a an annotation processors.

LexManos commented 6 years ago

We need to keep backwards compatibility because people have their old projects and build servers that we are not going to break. Java9 support isn't going to happen anytime soon. And honestly. We're going to have to break things for 1.13 anyways we may do a Gradle bump then. But thats for when that happens.

Pokechu22 commented 6 years ago

If you're using mixin, mixin has an annotation processor (at least I'm pretty sure it does). But that'd be a issue with mixingradle, not forgegradle.

carif commented 6 years ago

@LexManos Ok and thx for the answer. ;)

Bluexin commented 5 years ago

And there is no real benifit of updating to higher versions.

I strongly disagree with this. New versions of gradle bring new (sometimes useful) features (like build scans added to gradle 4.3, kts having multiple release cycles and getting to 1.0 in gradle 5.0, ...)

We need to keep backwards compatibility because people have their old projects and build servers that we are not going to break.

This shouldn't be an issue, as your breaking changes would be in a newer FG version, while their projects still reference the older, compatible FG.

And honestly. We're going to have to break things for 1.13 anyways we may do a Gradle bump then. But thats for when that happens.

Again, that would be FG version 3.x, which wouldn't break older projects as they'd be referencing FG 2.3.

LexManos commented 5 years ago

FG 3 is going to break things and bump the gradle version. But thatll be for 1 13, which wont aolve the issue for 1 12.2- users which is what you wanted.