Again: Writing a plugin for a new language

Hello everyone,

I am sorry, if this has been asked already so many times, or if the answer is evident somewhere, but I am apparently not able to find or recognize hints, maybe due do my limited Groovy skills.

I have a project which uses the java-library plugin to compile some .java files to a .jar file. This works fine but is the plain default behaviour of that plugin.

Now, in the same project, I would like to “compile” other files, too.
Let’s say the source files have suffix .a, the compiler is called a2b and the output files have suffix .b .
Let’s say the source files are placed folders below src/main/a/
and the b files shall be put into build/b/
I imagine it would make sense to write a little plugin called APlugin.

Unfortunately I do not see how to achieve this simple thing.
My APlugin contains hardly more than the hello world example.
I imagine I should define a SourceSet for locations of a and b files.
But e.g. I have no idea how I gradle gets the idea to skip compilation of an a files if the corresponding b file is up-to-date.

So, my question is very similar to this very old one.

Could someone please be so kind and point me to a simple example or docs?

This cannot be so difficult, in a makefile this would be only a couple of lines.

Thank you very much
Stefan


EDIT:
I now found