Chilli
04/16/2021, 8:03 AMimplementation
and compileOnly
? The only difference I found on Google is that implementation
is available at runtime, but what does it mean exactly? Without a special plugin, Gradle doesn't shade dependencies anyway, no?Big Chungus
04/16/2021, 8:41 AMimplementation
is different from api
Albert Chang
04/16/2021, 8:44 AMcompileOnly
dependencies are only used to provide symbols at build time and won’t be packaged into built program. This is useful e.g. when you are building a library and you provide RxJava bindings but not all users use RxJava and you don’t want RxJava dependency to be added for those who don’t, in which case you can use compileOnly
.Albert Chang
04/16/2021, 8:47 AMimplementation
dependencies are not available to the consumer of the library while api
dependencies are.Hanno
04/16/2021, 9:00 AMno
04/16/2021, 9:01 AMChilli
04/16/2021, 10:31 AMimplementation
and api
and not compileOnly
.algo112
04/16/2021, 3:28 PMcompileOnly
: put the dependency only on the compile classpath
implementation
 : put the dependency on compile and runtime classpathwakingrufus
04/16/2021, 6:24 PMcompileOnly
will not put the dep on B's runtime nor compile classpath, implementation
will put it on B's runtime classpath only, and api
will put it on B's compile and runtime classpath (like how compile
dependencies worked)Chilli
04/16/2021, 6:56 PMHanno
04/16/2021, 6:58 PMHanno
04/16/2021, 7:00 PM