Gradle
- test引用单元测试
// module A build.gradle
task testsJar(type: Jar, dependsOn: testClasses) {
classifier = 'tests'
from sourceSets.test.output
}
configurations {
tests
}
artifacts {
tests testsJar
archives testsJar
}
jar.finalizedBy(testsJar)
// module B build.gradle
dependencies {
compile project(':projecta')
testCompile project(path: ':projecta', configuration: 'tests')
}