android api implementation

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/baidu_31093133/article/details/82839791

android 3.0 新的依赖方式:

android 3.0

依赖方式 作用
api 和2.0的compile完全相同,参与编译和打包
implementation 比如APP依赖了Lib A,Lib A依赖了gson,那么App无法调用到gson,只能调用到Lib A。这种依赖方式可以让库只被当前model使用。
compileOnly 和2.0的provided一样,只参与编译不会参与打包
runtimeOnly 和2.0的apk一样,不参与编译,只在生成apk的时候参与打包,很少使用
testImplementation 和2.0的testCompile一样,只在单元测试代码的编译和打测试包的时候有效,对debug和release包不起作用
debugImplementation 和2.0的debugCompile一样,只在debug模式的编译和最终打debug包的时候有效
releaseImplementation 和2.0的releaseCompile一样,只在release模式的编译和最终打release包的时候有效
annotationProcessor 代替2.0的apt

猜你喜欢

转载自blog.csdn.net/baidu_31093133/article/details/82839791