MinecraftForge / ForgeFlower

Forge's modifications to FernFlower. Fixing various bugs/inconsistencies. Main Repo: https://github.com/MinecraftForge/FernFlower
Apache License 2.0
80 stars 44 forks source link

Move to Gradle 6.8.1 and use java toolchains #87

Closed sciwhiz12 closed 3 years ago

sciwhiz12 commented 3 years ago

Updates the Gradle wrapper to 6.8.1 and moves the project to use the new Java Toolchains feature.

In short, Java Toolchains, added in Gradle 6.7 and enhanced in 6.8, is a feature that allows Gradle projects to define what JDK versions to use for the project and/or individual tasks, and automatically downloads them if missing and uses those JDKs. This allows for developers for ForgeFlower to not have to install JDK 8 and/or 9 by themselves, by having Gradle do the downloading automatically. (The installed JDKs and the downloaded JDKs are used in other projects that use Java Toolchains too, when needed.)

This also includes a small fix to a bug I've been encountering where deleting the built JARs or even the build folder in the ForgeFlower subdirectory does not allow recompilation of the classes and the rebuilding of the JARs, by forcing the jar task (and any other Jar task such as sourcesJar) to always run and ignore the UP-TO-DATE. This shouldn't really affect anything, as it only goes into effect when you build the project. See comment below.

Also has some general buildscript cleanup.

sciwhiz12 commented 3 years ago

Per feedback from Lex, I've removed the caching issue bugfix/workaround described in the second-to-last paragraph of the PR description, as it still needs further investigation as to the actual root cause of the problem.

sciwhiz12 commented 3 years ago

Upon further investigation (using a seperate Linux install), I've determined the issue to be local to my Windows installation on my machine. Therefore, the fix/workaround will remain removed.

LexManos commented 3 years ago

Sorry I forgot about this, and thanks for doing it. Just a cleanup I never got time to do.