https://kotlinlang.org logo
#announcements
Title
# announcements
s

ShootingStar

12/11/2019, 12:41 AM
In a Kotlin project with the gradle build, Is there a usecase to use a
java-library
plugin even though I already use kotlin gradle plugin?
m

Mike

12/11/2019, 2:07 AM
Technically, it uses the java plugin, and not the java-library plugin. Also, implementation is the new compile. The java-library also adds the concept of api vs implementation for dependencies. An api dependency will become a transitive dependency for anything that depends on the library. An implementation dependency will be available for compiling the project, but it won't be included transitively by projects that depend on the library.
p

pniederw

12/11/2019, 6:28 PM
I think it does make sense for kotlin libraries (rather than apps). If I'm not mistaken,
java-library
depends on
java
anyways, so it's not a problem that
kotlin
also depends on
java
.
m

Mike

12/11/2019, 6:30 PM
Yes, both java-library and kotlin 'extend' the java plugin. Internally, if it isn't already applied, then they will apply it. Just wanted to make the distinction that java-library is more than java, and Kotlin builds on the java, and not the java-library plugin.
2 Views