MrCrayfish / ModelCreator

A program to create JSON models for blocks
Other
121 stars 64 forks source link

Using a gradle project structure #153

Closed HoldYourWaffle closed 5 years ago

HoldYourWaffle commented 6 years ago

For another project of mine I needed this to have a gradle based project structure, and I figured it wouldn't hurt to create a PR in case somebody else would need that (why re-invent the wheel?). Feel free to close this if you don't think it suits the project.

The biggest change is the addition of the SharedLibraryLoader, stolen from provided by (apache license) the good folks over at libgdx (a library built on top of LWJGL which uses gradle). I simply back-ported it to the LWJGL 2 native library names. It's required to load the LWJGL natives from the classpath.

I tried to use your code style, but it may not be completely accurate. If so please tell and I will fix it.

AndersBillLinden commented 6 years ago

What is the benefit of a gradle project structure (asked without any real experience of gradle)?

HoldYourWaffle commented 6 years ago

The main thing is that stuff like building and setting up your workspace is done automatically (including natives, which was the biggest pain for me to deal with without gradle). With gradle you can simply execute a gradle build, and your project jar is built. This is way more convenient than configuring things multiple menus deep in eclipse, or however you export something in eclipse.

Dependencies are handled automatically by gradle. This makes it very easy to update them, and they are automatically added to the classpath for each build (and of course your IDE). Any transitive dependencies will be taken care of (although that's not really applicable to this project). Because dependencies are handled automatically, it's very easy to move and setup a project on a different machine. Another benefit is the ability to use this project as a dependency in another project, which is why I need it.

There are many more benefits to using gradle, but these are the ones that I feel apply the most to this project (and that I could actually remember right now).

MrCrayfish commented 6 years ago

I will check this out soon! Definitely something that needed to happen to this project, inexperienced me four years ago decided not to do this. As of right now I'm not currently working on this project, however I will still merge this for anyone who wants to fork. I would love to get back into this soon, I want to move away from Swing and go LWJGL for most of the UI.

MrCrayfish commented 5 years ago

I managed to find some time to check this out and it works perfectly! It has inspired me to fix some common bugs I have found while using the program. Merging now!

HoldYourWaffle commented 5 years ago

That's great to hear! I've merged #137 and #141 into my fork, they seem to be working great.