加入含有類文件的 sorce set 的 JAR:
例22.8.為 source set 組裝 JAR
build.gradle
task intTestJar(type: Jar) {
from sourceSets.intTest.output
}
為 source set 生成 javadoc:
例22.9.為 source set 生成 javadoc
build.gradle
task intTestJavadoc(type: Javadoc) {
source sourceSets.intTest.allJava
}
為 source set 添加一個測試套件運行測試:
例22.8.source set 運行測試
build.gradle
task intTest(type: Test) {
testClassesDir = sourceSets.intTest.output.classesDir
classpath = sourceSets.intTest.runtimeClasspath
}