The solution I came to was to switch to Gradle as the build system. There's a bit of complication setting it up, but it works to some degree.