Issue
Android Studio 3.1 Canary 4
Build #AI-171.4444016, built on November 10, 2017
JRE: 1.8.0_152-release-1012-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 4.13.16-302.fc27.x86_64
Hello,
I have the following project structure. However, as I have some kotlin files I want to create a new folder called kotlin
under test
and create a new package and store all my kotlin files there.
Currently I have one called Java, but I want to create the kotlin, but can't seem to be able to find out how to do it.
I would like to do the same for androidTest
as well, so I can separate all my java and kotlin files.
Solution
Would like to give credit to denvercoder9 who posted the link to the proandoriddev.com article which solved my problem.
In my build.gradle file I have the following which worked for both the test and androidTest folders. However, I needed to create the folders first.
sourceSets {
main { java.srcDirs = ['src/main/java', 'src/main/kotlin'] }
test.java.srcDirs += 'src/test/kotlin'
androidTest.java.srcDirs += 'src/androidTest/kotlin'
}
If anyone need any help on this you can reply back to this solution.
Answered By - ant2009
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.