Generator of C++ sources

Hello guys,

I desperately need a help. I’m trying to change building of my hobby project OTest2 to Gradle. The key component of the project is a processor parsing some DSL files (very close to C++) and generating new C++ sources. Hence, I need to create a Gradle plugin doing this stuff.

My idea is quite simple. I would like to apply, following the declarative and convention principles, the plugin simply on a C++ gradle project:

plugins {
  id 'cpp-library'
  id 'net.staon.otest2.compile'
}

library {
  baseName = 'otest2'
  linkage = [Linkage.STATIC]
}

The plugin should be able to find the DSL files (i.e. src/main/otest2) and inject somehow generated source files into the C++ compilation tasks. I’m not able to find any useful documentation or tutorial (the thousand of the Greeting tutorial plugins is not useful). What is the correct way to do this? Or should be the plugin designed in some other way?

Thank you, Ondra.