I need to execute a copy task before an integration test and this is how I am doing it.
println "project dir is" + "${buildDir.parent}"//this line prints the path of the directory fine when i run the script
//here is my copy method which needs to run before the test task
test.doFirst {
copy {
from '${buildDir.parent}/test/xx.xml'
into '${buildDir.parent}/build/classes/test'
}
}
Below is the output on the console when I run gradle test:
Output: the project directory isC:\Users\xxx\git\xyz\xyz\xxx
However when I run the test task the file is not getting copied
Please help!