如何从Release Build中排除模块



我有一个TestFixture模块,它包含应用程序中不同模块的共享测试依赖关系。然而,在我的发布版本中,这个模块是完全不必要的,因为我的应用程序(测试之外(从未引用过其中的任何项目

有没有办法将这个TestFixture模块从我的发布版本中排除?

我的所有模块

testImplementation project(':testfixtures')

测试夹具模块

implementation project(':app')
implementation project(':server')
implementation project (':data')
implementation project(':cache')
implementation project(':core')
implementation "androidx.test.ext:truth:$androidxExtTruthVer"
implementation "com.google.truth:truth:$truthVer"
// Testing Moshi
implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
implementation "com.squareup.moshi:moshi:$moshi_version"
kapt "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
... Other implementations

你能分享你的项目级别等级吗?你也可以通过这种方式排除

configurations {
compile.exclude group: "junit", module: "junit"
}

最新更新