我已經具備以下條件:如何在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