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')

}
posted @ 2019-06-17 18:55  czy21  阅读(754)  评论(0编辑  收藏  举报