as下Gradle 3.0依賴ar包的幾種方式
v2.0 | v3.0 | 說明 |
---|---|---|
compile | api | 這種是我們最常用的方式,使用該方式依賴的庫將會參與編譯和打包。 |
provided | compileOnly | 只在編譯時有效,不會參與打包,可以在自己的moudle中使用該方式依賴。比如com.android.support,gson這些使用者常用的庫,避免衝突。 |
apk | runtimeOnly | 只在生成apk的時候參與打包,編譯時不會參與,很少用。 |
testCompile | testImplementation | testCompile 只在單元測試代碼的編譯以及最終打包測試apk時有效。 |
debugCompile | debugImplementation | debugCompile 只在debug模式的編譯和最終的debug apk打包時有效。 |
releaseCompile | releaseImplementation | releaseCompile 僅僅針對Release模式的編譯和最終的Release apk打包。 |