How to organize a project as it grows more complex and depends on multiple languages and compilers across multiple operating systems?

I wrote a Music Player and Library in Java for GNU/Linux and Windows.

My build process is currently in ANT, but I intend to migrate away from that to something more modern after the next release. Probably Gradle.

The project was originally in pure Java, but in order to get access to certain features, I’ve had to start special-casing different native features and linking them into my program using JNI.

Here’s an outline currently:

  • Hypnos Base – written in Java
  • JXGrabKey – An existing open source hotkey library, modified by my project to support javafx.
  • GNU/Linux Native Launcher – written in C++, compiled with g++.
  • Windows Native Launcher – written in C++, compiled with cl.exe.
  • GNU/Linux GTK Tray Icon – written in C, compiled with gcc.

My src tree is currently done the standard way for Java:

  • src
    • net
      • joshuad
        • hypnos
          • [all the Hypnos Base code and packages]
    • jxgrabkey
  • packaging
    • NSIS Script for windows installer
    • AppImage stuff for standalone linux runtime

For the various natively-compiled code, I was compiling it by hand as needed, and then providing it to ANT in binary form to do my packaging.

As I’m adding more and more native code, I’m starting to want to be able to recompile the entire project on demand, rather than having to manually do each module before starting ANT. It feels irresponsible to have an open source project where the build process is arcane.

My primary development system is Ubuntu 18.04. Prior to today, all of the build code was doable on that system. Now I’ve added the native launcher for windows, which is currently compiled with cl.exe and targets 64-bit Windows. It’s relatively simple code (~60 lines) with a single function, WinMain, some basic library linking work and then handing things over to jvm.dll.

This post may be too open-ended for this site, but I figured I’d give it a shot. What are some paradigms or resources I can use to try to make my build process a bit more sane?