alecgorge/jsonapi

Consider using branching for multiple MC version support instead of preprocessing

Opened this issue · 3 comments

Create a branch for each MC version support, remove the preprocessing tags and "generated sources" and simplify the build process to only use maven.

I don't think that using preprocessing to support multiple versions of MC, works that well. In fact, I'm able to bet that it's not even currently working at all or, the very least we don't really know.

Using preprocessing with non-standard notation in the code and placeholders for replacing just some strings in a few files is overshoot. Just look at the convoluted build process. A coffee script to generate a build script to only then launch maven. To get the code building and running on a IDE it's not easy as well and adds difficulty to the onboarding of new developers that get lost on all of those build scripts and cryptic dependencies.

Furthermore, and in reality, supporting multiple versions using only preprocessing isn't it something that is impossible to achieve? Each new version brings new methods, behaviors, signatures, deprecations, you name it. Getting all of this right with preprocessing is falling into the ifdef/ifndefs programming in C. However, we are not developing an Operating System nor we are developing in C.

By using instead a branch with tags for each MC version you could drop the preprocessing, turning the build into a much more simpler, cleaner, understandable and less error prone process. Regarding the development it would also allow everyone to develop on the version support they are interested without having to juggle around with preprocessing notation. Of course, branching would not solve everything. You would need some careful consideration on new features and how they would need to be merged across the branches. However, branching and merging is second nature to git, so you can concentrate on what you need to merge.

Cheers

You are all right, however the author stopped to develop this plugin years ago ^^

Yes. I know :). You can consider this a .plan, a mental note. I'm working on my fork in this direction and I'm raising here the issues and making pull requests to fix them (following the "patches welcome" motto) in the hopes of provoking and spark some interest of the brilliant minds out there back on the project. ;)