I have added processResources to include all property files WITH ITS FOLDER STRUCTURE inside the gradle build as below. But how can I make sure this “processResources” getting invoked ONLY with gradle build. Because I have other custom tasks (like copyTask) to create some local setup. When I am invoking my other custom tasks, this processResources is also getting invoked.
processResources {
from ('src/main/java') {
include '**/\*.properties'
}
}
This should not happen, unless you have some form of dependencies between tasks (either direct via dependsOn or indirect via depending on output of another task).
I tried it with <<. But I don’t see the .property files are getting copied after the build. It is creating the directory structure in resources folder. Below is the complete task.
processResources << {
println ‘Task ***** wallet-job processResources ***'
from (‘src/main/java’) {
include '/*.properties’
}
}
Oh duh, I see what you typed. You need to do the following:
// This is configuring the task
processResources << {
from ('src/main/java') {
include '**/*.properties'
}
}
// This is appending an action to the task
processResources << {
println 'Task ***** wallet-job processResources *****'
}