Hi all,
I’m new to Gradle and have been tasked with developing a plugin to run some static analysis (HP Fortify) on a set of sources (Only Java at the moment).
I have a working prototype which simply executes the command line behind the scenes. The trouble is that all of the options the command line needs have to be set in the build script. It has been requested that I make it more gradle like and assume some reasonable conventions by defult. So if nothing on the task is configured, I want to run a scan against whatever the Java plugin feels is the source code and place the results in some known location relative to the top level dir of the project.
So, my question is, how can I programmatically retrieve this information (the location of the sources and the root directory of the project) from within my custom task?
For bonus points: Is there any way to determine which languages are being used in the build and extract the source location for each of them?
I have found a method called getSource() in both:
org.gradle.api.tasks.SourceTask
org.gradle.language.nativeplatform.tasks.AbstractNativeCompileTask
Perhaps that will inspire some ideas?
Cheers!!!
Robert