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

原文链接:How do you get started with Kotlin (not for Android), or init a project?

© 版权声明
THE END
喜欢就支持一下吧
点赞11 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容