我已经具备以下条件:如何在distZip中包含测试类?
task packageTests(type: Jar) {
from sourceSets.test.output
}
distZip {
into(jarFolderName) {
from '.'
include 'conf/**'
}
into(jarFolderName) {
from '.'
include 'bin/**'
fileMode = 0755
}
into(jarFolderName) {
from 'build'
include 'logs'
}
}
添加dependOn将创建试验瓶,但我怎么能那么它包含在分配zip文件?
谢谢!如果我将'from sourceSets.test.classes'更改为'from sourceSets.test.output',那对我有用。 – morja
你是否也知道如何创建一个distZip,其中还包含测试依赖项? – morja
使用fat-jar插件并自定义fatJar任务(这是一个Zip任务)https://github.com/musketyr/gradle-fatjar-plugin – JBaruch