Certain detectors like MissingTranslation rely on Gradle specificvariant field to do checks. When invoking Lint from CLI and using project.xml we don't pass this information thus it is not run. (We don't pass it before because there is no documented way of doing so)
A possible fix is to move completely to lintModel.xml like Gradle does, but it is quite complicated and need lot of ceremony in Bazel to coordinate and setup the correct directories for lint. As an alternate solution, I found that we can pass lintModel.xml to project.xml's model attribute like this. This makes each project to have a variant as expected by many detectors.
Implementation
This PR attempts to create this lintModel.xml using basic information especially passing resourceConfigurations. Other expected components of lint model.xml like dependencies.xml and libraries.xml are empty as they do not seem to be used in my testing.
The generated lintModel.xml has to be passed through the graph similar to partial results, so lint provider is modified accordingly to accomodate that.
Additionally, certain detectors expect resources to be passed as folders instead of files. For example . This PR changes resources to be passed as directory instead.
Added tests and updated sample tests to reflect the changes.
Next
Certain attributes are hardcoded, which needs to come from bazel in the form of action input like resConfigs. We can generate this via grazel.
Context
Certain detectors like
MissingTranslation
rely on Gradle specificvariant
field to do checks. When invoking Lint from CLI and usingproject.xml
we don't pass this information thus it is not run. (We don't pass it before because there is no documented way of doing so)A possible fix is to move completely to
lintModel.xml
like Gradle does, but it is quite complicated and need lot of ceremony in Bazel to coordinate and setup the correct directories for lint. As an alternate solution, I found that we can passlintModel.xml
toproject.xml
'smodel
attribute like this. This makes each project to have a variant as expected by many detectors.Implementation
This PR attempts to create this
lintModel.xml
using basic information especially passingresourceConfigurations
. Other expected components of lint model.xml likedependencies.xml
andlibraries.xml
are empty as they do not seem to be used in my testing.The generated
lintModel.xml
has to be passed through the graph similar to partial results, so lint provider is modified accordingly to accomodate that.Additionally, certain detectors expect resources to be passed as folders instead of files. For example . This PR changes resources to be passed as directory instead.
Added tests and updated sample tests to reflect the changes.
Next
resConfigs
. We can generate this via grazel.