gzoritchak / todokotlin

A kotlin multiplatform (JS/JVM) todo application
Other
14 stars 3 forks source link

Use Gradle Kotlin DSL #1

Open sdeleuze opened 5 years ago

sdeleuze commented 5 years ago

Since Gradle Kotlin DSL is now mature and Gradle/JS plugin published on Gradle portal, I would suggest migrating the build to Gradle Kotlin DSL. See https://github.com/sdeleuze/spring-kotlin-fullstack for an example (contributed directly by JetBains).

gzoritchak commented 5 years ago

I'm still not convinced.

I don't understand the structure and the choices, and also we should be able to write these build files without JetBrains contribution (even if it's very nice from them to provide help).

plugins {
    kotlin("multiplatform") version "1.3.40" apply false
    kotlin("js") version "1.3.40" apply false
    kotlin("plugin.allopen") version "1.3.40" apply false
}

Why apply false. It's a trick? Why no variable fo kotlin version? You indicate in the README run Application.kt in IDEA. But there is this bug when launching directly from IDEA. When I launch my server main function from IDEA, the jvmMain/ressources directory is not added in the classpath and I get huge logs.

sdeleuze commented 5 years ago

I agree that the structure is not straightforward, I think we need to discuss that with Jetbrains in the #multipatform channel of Kotlin Slack to understand what is temporary and what will be improved later. The dependency structure puzzles me. For the other points:

apply false allows to define the version without applying the plugins (they will be enabled in sub modules).

I have updated the plugins block to use a variable.

plugins {
    val kotlinVersion = "1.3.40"
    kotlin("multiplatform") version kotlinVersion apply false
    kotlin("js") version kotlinVersion apply false
    kotlin("plugin.spring") version kotlinVersion apply false
}

I have added a comment on KT-24463 which indeed prevent to run the application from the IDE, and updated the README accordingly.