【发布时间】:2017-03-25 02:16:22
【问题描述】:
我需要在集成测试之前执行复制任务,这就是我的做法。
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
但是,当我运行测试任务时,文件没有被复制
请帮忙!
【问题讨论】:
-
您在谈论文件,但您只是想复制一个文件 xx.xml。对吗?
-
doFirst中有很多copy方法,但都是类似的copy方法,所以为了方便阅读,我只贴了其中一种方法。
-
@SanDroid 已更正!
标签: gradle build.gradle