What is an “implementation” in Kotlin Gradle dependencies?

I am using Android Studio 3.0 Preview to launch a new Kotlin project. When I try to add dependencies to build.gradle, I saw an area implementationinstead of the usual one compile.

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'

There is also androidTestImplementationand testImplementationarea.

In the end, I add compileto add third-party dependencies, and it works.

compile 'io.reactivex.rxjava2:rxandroid:2.0.1'

So my questions are ...

  • What is implementation, androidTestImplementationand testImplementationscope?
  • Isn't that different from compile, testCompileand androidTestCompile?
  • Which should I use for my project in Kotlin?

Edit: My bad, this question is not specific to Kotlin. This is the new Android Gradle Plugin Configuration .

+6
2

Kotlin, Gradle Android.

compile, provided apk .
implementation api compile, compileOnly provided runtimeOnly apk.

. A, B, , , C, C A. A C , A C.

implementation : implementation project(':C') B, C A . .

. Gradle.

+17

gradle v3.0.0-alpha1 compile, .

?

, compile, , , . , , , , , .

. , Library_Image_Upload, Image uploading . Library_Network lib Library_Image_Upload, . . , Library_Network lib Library_Image_Upload, , lib, Image uploading , - ( strong > ). , Library_Network Library_Magic_Image . , API, Library_Network, , , , .

implementation :

  • , .
  • classpath
  • :
  • : maven-publish Java POM, , , , ( , , , ).

... Java

, , .

, .

+1

All Articles