https://kotlinlang.org logo
Title
g

Gabriel Desilets

11/20/2019, 2:06 PM
Hi guys ! i've got a question about the java/kotlin/scala world.. I come from PHP symfony, ruby with rails and Elixir with phoenix where the ecosysteme of these lang and framework are quite different in my opinion(don't hate me) and now i work for a company that use java8 with ant/maven and on my free time i've start a rest api with Kotlin + maven because i don't really know anything else yet in java for dependecies management, but everything i look up packages or specific kotlin deps all i see is gradle, gradle plugins, trying my hand to port some in maven to no succes and i was wondering what's the main difference between these 2. Why gradle is so much present with kotlin and is the default vs maven, i want to learn and build my sideproject with the best practices because i think my company will benefit from kotlin for mobile and web instead of java8 + old springboot. My general feeling is that anything related to the JVM is bloated and i'm having a hardtime wrapping my head around everything. PS if i've written my post in the wrong channel tell me i'll correct the problem
e

eekboom

11/20/2019, 2:27 PM
Phew. A bit more structure in your “question” would have been nice. It is hard to see what “the” question actually is.
You can start a kotlin project with gradle quite easily: Download latest gradle version, create a directory for your new project and in the project directory execute this in a terminal: ./gradlew init --type=kotlin-application --distribution-type=all
g

Gabriel Desilets

11/20/2019, 2:32 PM
@eekboom sorry my bad, my train of tought went off track a bit 🚆 . but my real question is Why Gradle > Maven. Most of the kotlin lib i saw the documentation is gradle only, some maven port but no plugin support, so i'm thinking of switching to gradle but i don't see why gradle seems more popular.
r

Rory Armstrong

11/20/2019, 2:47 PM
Two reasons I can think of: • It's not XML • You can write your build scripts using kotlin https://docs.gradle.org/current/userguide/kotlin_dsl.html
Also a large audience for Kotlin develop on Android which also uses gradle as default so it better aligns with that ecosystem
j

Joffrey

11/20/2019, 3:01 PM
I'd say: flexibility, speed, conciseness. It has the same conventions as maven, so the migration is easy, but it does not force you to follow hardcoded phases etc. Also, being able to use Kotlin in the build script is a great thing to me 🙂
e

eekboom

11/20/2019, 3:07 PM
Especially gradle-with-kotlin-dsl is great: You have strong conventions, so standard project setup is very easy, but also the full power of kotlin do anything extra/special that your project may require. (While in maven you often need to use or even write a plugin.) All that with great IDE support - kdoc, navigation, error highlighting, completion all work great.
f

fitzoh

11/20/2019, 3:22 PM
I might add that the kind of people who use Kotlin are more likely to be the kind of people who use Gradle. They both stray a bit from the more established option for fancy new features and better ergonomics
👍 1
j

Joffrey

11/20/2019, 3:23 PM
Nicely put.
g

Gabriel Desilets

11/20/2019, 4:44 PM
Great thanks guys ! Very helpful comment ! i'll try to do some test to present to my sernior java dev. They like their maven
n

napperley

11/20/2019, 10:17 PM
Note that in the Kotlin 2018 Census 86% of Kotlin projects use Gradle: https://www.jetbrains.com/research/kotlin-census-2018/