DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

How do you get started with Kotlin (not for Android), or init a project?

I came from Android, so I use gradle.

brew install gradle
mkdir project && cd project
gradle init  # choose application, kotlin and groovy DSL
# Open the project in IntelliJ
Enter fullscreen mode Exit fullscreen mode

But recently, I see that Maven is quite good, and might be more simple, although I don't like the looks of XML (pom.xml) (but can I adapt.)

Also, do you use IntelliJ or VSCode, or something else? I am starting to migrate from IntelliJ to VSCode...

Also, what to you put in .gitignore? Gradle init suggests,

# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build
Enter fullscreen mode Exit fullscreen mode

But https://www.gitignore.io/ is more complex -- https://www.gitignore.io/api/kotlin

Still, I have to manually add

!/lib/**/*.jar
/bin/
/build/
/.gradle/
Enter fullscreen mode Exit fullscreen mode

Top comments (4)

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

What kind of Kotlin project are you doing?

Diane's tip about using IDEA's project generator is good.

If you are doing Spring Boot, use start.spring.io/

If you want to do something else, look whether they have a sample respository, that's usually a fastest way to get started

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I usually dislike boilerplate, so I use Javalin. (used to use Spark Java).

Another kind I usually do is a desktop app. I have made some libraries (and uploaded to Maven) as well.

Maybe I should learn boilerplate-esque, like Spring Boot, Django, Nest.js... (Still, I am OK with Nuxt, Vue CLI, but not Quasar)

Collapse
 
jmfayard profile image
Jean-Michel πŸ•΅πŸ»β€β™‚οΈ Fayard

For desktop apps, wre you aware of tornadofx.io/ ?

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt

Yes, and I never really tried JavaFX.

But I find Electron to be way more convenient. That's why I wrote this. JavaFX WebView is not fast.