I'm trying to get the `kotlin` srcDirs like this: ...
# gradle
l
I'm trying to get the
kotlin
srcDirs like this:
Copy code
android.sourceSets[flavor].kotlin.srcDirs
However there is no such property. This on the other hand works:
Copy code
android.sourceSets[flavor].java.srcDirs
Looks like the
kotlin
and
java
properties return a different type. In each case it has the same name,
AndroidSourceDirectorySet
but is in different packages - for
kotlin
it's in
com.android.build.api.dsl
but for
java
it's in
com.android.build.gradle.api
and it's deprecated.
Looks like in the new API you can only add srcDirs, but not query them
h
There is
android.sourceSets
starting from AGP 8, but they returns a
AndroidSourceDirectorySet
and a
AndroidSourceDirectory
.
l
Ok, I'm on AGP 7 currently, I guess I can resolve it after upgrading. Thanks for the hint!