https://kotlinlang.org logo
Title
n

nuhkoca

11/10/2019, 7:50 PM
Hi all, is there anyone help me about how can I add
kotlin sourceSets
to my project. Below is not working. I am really stuck on it.
sourceSets {
        getByName("main").java.srcDirs("src/main/kotlin")
    }
o

octylFractal

11/10/2019, 7:51 PM
did you already apply the kotlin plugin?
n

nuhkoca

11/10/2019, 7:52 PM
yes I did so
o

octylFractal

11/10/2019, 7:53 PM
then you should already have this as a sourceset
n

nuhkoca

11/10/2019, 7:54 PM
plugins {
    id(Plugins.androidApplication)
    kotlin(Plugins.kotlinAndroid)
    kotlin(Plugins.kotlinAndroidExtension)
    kotlin(Plugins.kotlinKapt)
}
@octylFractal order is important here?
o

octylFractal

11/10/2019, 7:55 PM
order is not important
n

nuhkoca

11/10/2019, 7:55 PM
It is still
java
looks like a special case
n

nuhkoca

11/10/2019, 7:58 PM
Thanks @octylFractal I got the example from doc you sent but it is still same and so annoying 😕
o

octylFractal

11/10/2019, 8:02 PM
n

nuhkoca

11/10/2019, 8:10 PM
thanks @octylFractal let me try it out, thanks for your help 🙂
n

nrobi

11/11/2019, 7:33 AM
Here’s an example, hope it helps
n

nuhkoca

11/11/2019, 6:29 PM
@nrobi thanks for comment. I tried it out but as it seems now java folder is disappearing. Should I replace
src
and
resources
strings with anything else?