How to Use a Task Listener in a different process ?

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Jul 13 14:59:44 UTC 2017


Anything to do with contexts is internal API, and hopefully you should 
not need to go there.

If you're dealing with the compiler in another process, I'd recommend 
you investigate the -Xplugin option.  With the option, you can register 
a plugin as a service, and request that it be started from the command 
line, with any desired arguments. The plugin will be located on the same 
path(s) used for annotation processors (i.e. -processorpath).  When the 
plugin is invoked, you can create and register task listeners.

-- Jon



On 7/13/17 7:42 AM, Stéphane NICOLAS wrote:
> Hello,
>
> in gradle, they run the compiler in a different process.
> I am wondering how to pass a TaskListener in the context. I saw there 
> was a call to context.get(TaskListener.class) but couldn't find the 
> entry point to add it properly to the context,
> especially if the task is gonna run in a different process.
>
> How is it supposed to work ?
>
> Thanks in advance,
>  S.
>



More information about the compiler-dev mailing list