I am writing a custom plugin to assist in tests and a few other things. The custom plugin has a number of tasks. A few of the tasks need to access the main project’s /src/main/resources folder.
What is the best way to do this?
plugin code :
class CustomPlugin implements Plugin {
void apply(Project project) {
project.afterEvaluate {
Task customTask = project.tasks.create("startDatabase", StartDatabaseTask)
customTask.setProperty("portNumber", randomPort)
// i need to read the project /src/main/resources from inside the custom task.
}
Would be grateful if someone can point out the best way to do this.
Thanks