我正在使用Android Studio 3.0 Preview来启动新的Kotlin项目。当我尝试在build.gradle
中添加依赖关系时,我看到了implementation
范围,而不是通常的compile
。什么是Kotlin Gradle依赖关系中的“实现”?
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:25.3.1'
testImplementation 'junit:junit:4.12'
还有androidTestImplementation
和testImplementation
范围。
最后,我添加compile
添加第三方依赖关系,它的工作原理。
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
所以我的问题是..
- 什么是
implementation
,androidTestImplementation
,并testImplementation
范围是什么? - 它与
compile
,testCompile
和androidTestCompile
有什么不同吗? - 哪一个我应该用于我的Kotlin项目?
编辑: 我的不好,这个问题不是Kotlin特有的。这是新的Android Gradle Plugin configuration。