Eduard Boloș
10/25/2022, 2:04 PMlint
task taking significantly longer with data builders enabled. And after realising that I can actually debug the task in Android Studio, I found out that the directory with the generated Apollo source is included both in the generated sourcesets and the java sourcesets (see screenshot in 🧵). I am not 100% sure, but I assume this is the cause. Anyway, is this intentional? Shouldn't this directory be only in the generated sourceset?Eduard Boloș
10/25/2022, 2:04 PMmbonnin
10/25/2022, 2:08 PMAnyway, is this intentional?I'm not sure. Maybe this can be useful? (even if it surely doesn't look useful in your case)
Shouldn't this directory be only in the generated sourceset?Maybe? We're using `srcDir()` on the kotlin sourceSet. I was not aware of an API to tell AGP that a specific directory is generated. I'll ask around
mbonnin
10/25/2022, 2:14 PMmbonnin
10/25/2022, 2:15 PMmbonnin
10/25/2022, 2:17 PMEduard Boloș
10/25/2022, 2:17 PMI was not aware of an API to tell AGP that a specific directory is generatedWhat would be the goal? I see other folders in
build/generated/source
that are not marked as source, including where BuildConfig.java
lives, but they are still picked up in the build.
In theory, I believe lint should process generated files.There is a specific lint option to enable this, so I don't think that a library should overrule this, knowingly or not 😛
mbonnin
10/25/2022, 2:19 PMWhat would be the goal? I see other folders inDoes that meanthat are not marked as source, including wherebuild/generated/source
lives, but they are still picked up in the build.BuildConfig.java
build/generated/source
is automatically picked up by the compileKotlin
task?Eduard Boloș
10/25/2022, 2:20 PMmbonnin
10/25/2022, 2:21 PMEduard Boloș
10/25/2022, 2:21 PMmbonnin
10/25/2022, 2:21 PMmbonnin
10/25/2022, 2:22 PMmain
. But I think we have tests that generate source in build/generated/source/com/example
and add it to the debug
variantEduard Boloș
10/25/2022, 2:22 PMbuild/generated/source/kapt
has subfolders with the variants names which are marked as "generated sources root" tooEduard Boloș
10/25/2022, 2:23 PMjavaSourceFolders
😕mbonnin
10/25/2022, 2:24 PMThere is a specific lint option to enable thisRight 👍 , means we need to tell AGP that we are a generated dir, I'll dig ⛏️
mbonnin
10/25/2022, 2:25 PMEduard Boloș
10/25/2022, 2:25 PMEduard Boloș
10/25/2022, 2:25 PMmbonnin
10/25/2022, 2:32 PMmbonnin
10/25/2022, 2:32 PMmbonnin
10/25/2022, 2:32 PMmbonnin
10/25/2022, 2:35 PMEduard Boloș
10/25/2022, 4:12 PMcom.android.tools.lint.detector.api.LintModelModuleProject#getJavaSourceFolders
is the method that returns that list.
A breakpoint where I could see that was in com.android.tools.lint.LintCliClient#run(com.android.tools.lint.client.api.IssueRegistry, com.android.tools.lint.client.api.LintRequest, kotlin.jvm.functions.Function0<kotlin.Unit>, kotlin.jvm.functions.Function0<java.lang.Integer>)
, in lintRequest
argument, projects[0]
field.mbonnin
10/25/2022, 4:15 PM