I believe I figured out the problem. You should always call setInvocation
on the compiler instance before calling a lot of the methods on the compiler instance, as it actually just proxies to the invocation.
I moved the setInvocation
call to right after the CompilerInvocation object is created, and things now work.