一些 source set 的例子

2018-07-01 17:10 更新

加入含有類文件的 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 添加一個(gè)測(cè)試套件運(yùn)行測(cè)試:

例22.8.source set 運(yùn)行測(cè)試

build.gradle

task intTest(type: Test) {
    testClassesDir = sourceSets.intTest.output.classesDir
    classpath = sourceSets.intTest.runtimeClasspath
}


以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)