Search code examples
gradleandroid-lintgradle-task

gradle Lint plugin defined task for include or exclude custom files


I am using gradle lint plugin in my Android project on CI Server. But sometimes I want to run android lint only on custom files, just like gradle Copy Task include and exclude to defined task scope in my gradle task.

In Android Studio, inspection can defined these behavior. But in my case, it is gradle task run on CI Server without UI interaction.


Solution

  • I don't think the Gradle Plugin is capeable of that. However you can also run lint on it's own.

    lint [flags] <project directory>

    You can get all of the options with:

    lint --help

    The executable is located in $ANDROID_HOME/tools/

    More information here.