0
我需要在集成测试之前执行复制任务,这就是我的做法。
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这个测试:
输出:项目目录为-C:\用户\ XXX \ git的\某某\某某\ XXX
然而当我运行测试任务时,文件没有被复制
请帮忙!
彼得niederwieser您AR谈论的文件,但你只是想复制一个文件xx.xml。这是对的吗? –
我在doFirst中有很多复制方法,但它们都是类似的复制方法,所以我只是为了方便阅读而发布了其中一种方法。 – SuryaVal
@SanDroid更正! – SuryaVal