1. 程式人生 > >android api implementation

android api implementation

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