"null" path component was showing up when gradle task was copying generated files to destination. I added a null check in the systempath() method, which caught the error. The problem was that at least one top-level val was not initialized, because earlier top-level expressions prior to the uninitialized val were still being initialized. I moved the problematic vals higher in the script, which solved the problem.
WIP!