Retrobuild — Java Build and Export System
Build system can create a lot of problems. Here's a look at Java Export and Build systems.
Join the DZone community and get the full member experience.Join For Free
Build system is one of the biggest troubles I have seen in various companies, both the ones I worked for and the one I consulted. The build process was always complicated (that only few people in the company knew) and requires tricks (tabs, new lines…).
I have built ClassyShark with the IntelliJ’s built-in option of exporting artifacts. As ClassyShark became bigger and complicated, the build artifacts process became more annoying. It was twiddling around checkboxes and options in UI, and making sure that each new dependency (jar) made its way to the release jar. Actually twiddling around the UI was just the symptom. The real problem was that I wasn’t in control on my build process, kind of living under IDE mercy. This made me really uncomfortable (think something changes in IDE etc’).
So I needed something better; build system! I looked at the following:
But I didn’t find them suitable for ClassyShark. Mostly due to the reasons of having build systems become more complicated than the project it builds, major changes to ClassyShark structure, adding and maintaining build scripts in various languages and formats.
So I wrote my own: Retrobuild, small, simple, and fast build and export jar system.
All in all, I needed four things:
- Make release folder
- Compile sources in release folder
- Copy dependency jars and extract their classes in the same release folder
- Create jar from classes in steps 2 and 3
And Retrobuild does them all written in written in a pure Java, debuggable, platform independent, rich ecosystem, familiar APIs. No need to look at XMLs, to wrest with complicated system, useful for my next projects and no ClassyShark code changes.
So far exporting ClassyShark with IntelliJ takes 2.7 seconds while with Retrobuild it takes 3 seconds. This is something I can live with.
Published at DZone with permission of Boris Farber, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.