我需要在集成测试之前执行复制任务,这就是我的工作方式。
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'
}
}
以下是我运行gradle test时控制台上的输出:
输出:项目目录是C:\ Users \ xxx \ git \ xyz \ xyz \ xxx
但是,当我运行测试任务时,文件没有被复制
请帮忙!