https://kotlinlang.org logo
Title
j

Joakim Tengstrand

06/22/2020, 12:46 PM
I can't get my Gradle DSL integration to work, IDEA doesn't understand that I want to have several src-filders. Any ideas? This is how my gradle.build.kts looks like, that lives on the root of my project:
plugins {
    kotlin("jvm") version "1.3.72"
}

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath(kotlin("gradle-plugin", version = "1.3.72"))
    }
}

sourceSets.main {
    java.srcDirs("components/logger/src",
                 "components/user/src")
}
d

diesieben07

06/22/2020, 1:09 PM
Enable the
idea
plugin:
plugins {
  idea
}
That usually helps for me
j

Joakim Tengstrand

06/22/2020, 1:43 PM
I aded that line + changed from "java.srcDirs" to "kotlin.srcDirs". The problem now is that "srcDirs" is marked red in IDEA.
d

diesieben07

06/22/2020, 2:00 PM
I just tried it, it worked fine here in a kts gradle I have
j

Joakim Tengstrand

06/22/2020, 2:18 PM
It works now. I had te reinstall gradle to use 6.5. Thanks!
m

Marshall

06/23/2020, 8:09 PM
I've done something similar to that example with a "core" project, a "cli" project, and a "webapp" project
j

Joakim Tengstrand

07/02/2020, 1:46 PM
That was awesome, thanks!