Simplify buildscript and add Fabric API modules comment. #84
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Steven/fabric-example-mod#84
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "LambdAurora/master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To ensure Java standard API compatibility with newer JDK on older JREs there is a dedicated Gradle feature which take advantage of the
--release
flag on the JDK9+.It's even recommended to use it as seen on the Gradle userguide.
It also deprecates the sourceCompatibility and targetCompatibility fields.
Also added a comment on Fabric API dependency informing developers of the module system to hopefully encourage people to not fully depend on the whole Fabric API if only a few modules are used.
No, not a fan of this.
Doesnt this download and use java 8? The idea before was to build on the newer JDKs while ensuring that it will run on 8.
Setting the release compiler arg does the same thing without actaully needing to run on java 8. I want to move further away from j8 this seems to be moving closer to it by not even ensuing stuff builds on newer versions.
Urf, wasn't aware of this, would make more sense to add something in loom to specify the target JVM version then instead of having an obscure option manipulation.
Its not so obscure, propper support for it was added in gradle 6.6 before it was a matter of setting a compiler argument.
https://docs.gradle.org/6.6/release-notes.html#javacompile-release
It does look like we could possibly make it a little neater.
When we first added this, sourceCompatibility/target was removed but I found its best to keep those in as well to ensure IDEs use the correct target version.
imo, Gradle should have added a proper field for that in the
java
block like it does forsourceCompatibility
andtargetCompatibility
.@modmuss50 I reverted the toolchain change and added back the release option flag, though I added a new field for which targetCompatibility, sourceCompatibility and the release option flag use for the java version so when changed it changes everywhere and there's not 3 different fields to set. Hopefully that's better, if really I can scrap entirely that and just let the Fabric API modules comment.
This seems better, might be worth adding a comment on the targetJavaVersion to say what it does, and that java 8 is recomended for most if not all mods due to the vanilla launcher shipping 8 by default.
Not quite sure why everyline in the gradlew.bat file was changed?
I'm not sure either, it was changed when I ran gradle wrapper to update the gradle distributions.
I can give you a hint here: You've likely created the current version on windows, with the autocrlf feature on (converting it to lf) while lambdaurora likely isn't (or the other way round).
I've noticed this on all Fabric projects I've touched until now.
The fix is simple, just add this to .gitattributes:
That way you can avoid Git converting it at all.
We need to be sure this actually works, knowing windows it might not.
A crlf .bat file is just fine. This line of
.gitattributes
served me well in other projects (although I also used some more, to enforce lf on the rest of the project).What's quite interesting is that a lf .bat file (like you have right now, I think) is also fine with cmd.exe.
./gradlew wrapper
generates crlf, though, I think it would be a good idea to put that into Git like that as well.Also, you should probably set up .gitattributes to enforce lf in
gradlew
, *nix shells aren't as permissive as cmd.so it appears that the toolchain from gradle is best used by ci. for ide users, this isn't too meaningful as they need to install proper java locally, and almost all mod devs code mods in ide and few need a fixed version of java in a ci. hence i don't recommend this change.
Checkout
From your project repository, check out a new branch and test the changes.