debugCompile(debugImplementation)和releaseCompile(releaseImplementation)
debugCompile(debugImplementation)
debugCompile 只在 debug 模式的编译和最终的 debug apk 打包时有效
releaseCompile(releaseImplementation)
Release compile仅仅针对 Release 模式的编译和最终的 Release apk 打包。
testImplementation 只在单元测试中有效。
使用说明:
有时需要在dev,qa中加载某些测试功能,而在release中不需要添加这些测试,就需要使用上面的编译命令,类似leakcanary,用于检测内存泄漏,在开发测试中很有帮助,但是在release中这些功能是多余的,也不应该让用户看到,所以leakcanary在release版提供了leakcanary-android-no-op库,在release中所有的操作都是空实现。