I found the answer in Stackoverflow in English, follows the translation:
It is one of the break changes that comes with Gradle: 3.0 that Google announced on IO17 Gradle: 3.0
To compile
configuration is now obsolete and should be replaced by implementation
or api
Of documents of Gradle :
dependencies {
api 'commons-httpclient:commons-httpclient:3.1'
implementation 'org.apache.commons:commons-lang3:3.5'
}
Dependencies that appear in settings api
will be exposed
transitively to library consumers and as such will appear
in the consumer compilation classpath.
Dependencies found in configuration implementation
, for
on the other hand, they will not be exposed to consumers and therefore will not be
leaked into the consumer build classpath. This comes with
several benefits:
Dependencies do not leak in the classpath ranking of consumers anymore,
then you will never accidentally depend on a dependency
transitive faster build thanks to reduced size of the
classpath less recompilations when deployment dependencies
change: consumers would not need to be recompiled publishing
cleaner: when used in conjunction with the new plugin Maven-Publish,
Java libraries produce POM files that distinguish exactly the
which is necessary to compile against the library and what is
needed to use the library at runtime (in other
words, do not mix what is necessary to compile the own
library and what is needed to compile against the library).
The build configuration still exists, but should not be used as it will not offer the guarantees offered by api
and
implementation
.
Just replace:
compile
for implementation
testCompile
for testImplementation
debugCompile
for debugImplementation
androidTestCompile
for androidTestImplementation
Clarifying: The consumer is the module that uses the library. In the case of Android, is the Android app.
implementation
x api
: If your application depends on the x library, it depends on y, z. If you use implementation
only x api will be exposed, but if you use api
y, z will also be exposed.
Source: What’s the Difference between implementation and Compile in Gradle
Ask
As far as I know, implementation has been supported in the newer version of Gradle
– Yago Azedias