Can someone tell me whats wrong with my sourcesets...
# gradle
g
Can someone tell me whats wrong with my sourcesets? Also sourceSets[“main”] returns the same error, but I can see my kotlin files in Android Studio Project in src/main/kotlin
l
Did you try with
getByName("main") { … /* Your code in the lambda, executed later. */ }
?
g
yes in multiple ways
Copy code
//java {
//    sourceSets {
//        getByName("main").java.srcDirs("src/main/java")
//    }
//}

sourceSets {
    getByName("main").java.srcDirs("src/main/java")
    getByName("test").java.srcDirs("src/test/java")
}
Because I read: With Gradle Kotlin DSL, configure source sets with java.sourceSets { ... } instead.
d
did you add the kotlin / java plugin? (sourceSets are defined by the java plugin)
you can then access to a sourceSets like
val main by sourceSets
g
Copy code
plugins {
    id("com.android.library")
    kotlin("android")
    kotlin("android.extensions")
    `maven-publish`
}
are my plugins
But I have kotlin-dsl in my buildSrc folder