I am adding Kotlin
SourceSets
to my project but I am unable to see Kotlin
source in the Project layout
.
What I have in build.gradle.kts
sourceSets {
getByName("main").java.srcDirs("src/main/kotlin")
}
What I see in the project path
And also when I run ./gradlew sourcesets
task I see 2 sources for the module.
I googled it but couldn't find useful info. How can I have kotlin instead of java ? Thanks.
Okay, It is too simple to do so. Just delete java source and create a new directory called kotlin inside main
. Everything will be done.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.