Porting over 10+ years of Makefiles to Gradle. Want to separate the metadata (lib/executable names, dependencies etc…) from the build script. In the following simplified example, I’m able to set the final executable name and sources dynamically.
model {
components {
hello (NativeExecutableSpec){
baseName = mySources.executableName
sources.c.source.srcDir mySources.srcDir
sources.c.source.include mySources.include
}
}
}
How can I set ‘hello’ dynamically. It doesn’t seem to work with properties. I believe the answer lies in Chapter 66 of the Gradle 2.4 User Guide - Rule based model configuration.
If it’s too involved to give me the whole answer, could someone just please tell me that IT IS possible and maybe give me some pointers, and I will continue to plug along to figure it out.
Thanks in advance!