How to create an external builder to invoke my own compiler

I have build my own compiler for my own language which compiles to Java bytecode.

I now want to integrate it with intellij so the compiler is invoked when building a project.

The compiler runs in an external process and communication is currently done with a custom TCP prototocol.

Is there any more information of examples how to create a plugin project with a jps plugin?

I want to use gradle as build tool.

What I have so far