Close

Build System Fine Tuning

A project log for Project Stark Framework

This is a YET ANOTHER attempt at an "Iron Man" Jarvis-like system

robweberrobweber 12/07/2016 at 18:470 Comments

Its been a while since I've had time to post anything on here. I've been spending a lot of time trying to reconfigure my build system for this project so that I may eventually be able to publish something usable.

My original build system was rather piecemeal, definitely the kind of thing you'd expect from a homegrown project that took on various layers over time. It utilized several Eclipse Java projects to break out the functionality of the Stark Framework, Module Libraries, and various helper libraries. To pull everything together there was a Git repo full of jar files and several Ant build files. A massive Jenkins project built the whole thing into a single tar archive that included everything, along with the configuration files. As you can imagine this system very quickly became problematic as the complexity of the project increased. Something as simple as adding a dependent library for a new Stark Module trickled down into numerous build files and various Eclipse projects when testing. To further complicate things I decided at one point that the modules themselves should be dynamically loadable. For anyone familiar with plugins in the Spigot (Bukkit fork) project of Minecraft, that is basically where I got the idea. Modules can be bundled in their own Jar files that can be put into a "modules" directory and loaded at run time.

This system, while ugly, worked for a long time. Then came the problem of attempting to use Stark outside my own home. I had a friend that wanted to "test drive" the system and I needed to be able to not only build, but distribute it. To further complicate things I wanted to include some modules but not others. My original massive Jenkins job was built on the idea of just bundling everything.

About this time I knew I needed to make this system better and use a real build system. I turned to Maven, since I was familiar with it from smaller projects I'd done previously. Re-configuring all these projects to use Maven and end up with a customizable result took lots of time and broke a lot of things in the testing process. The result now is a series of projects that can be built in Jenkins using the Maven lifecycle and uploaded to a Jar repository. Maven assemblies can build tar files for distribution easily. I also wrote a few small Bash scripts to help with updates and module distribution. Since the idea behind the modules is that they should be independent of the main Stark Framework there is a downloader bash script that can pull in modules from an HTTP server based on module name and version number. Now the modules can be independently installed and updated separate from the main program. This really saved time in testing and distributing things since the modules are what most often change. A quick snippet of how this would work on a Linux CLI is:

#stop the currently running service
sudo service stark stop

#download, or update, a module - syntax is module_name module_version
#this removes old versions of the module and downloads the new one

./download_modules.sh stark-core-modules 0.3.0

#start things back up
sudo service stark start

I'm hoping in the next couple months to release some files and instructions via this site.

Discussions