I am using Android lint with Jenkins and need to ignore library projects (specifically Action Bar Sherlock) that my team does not modify so that we can get useful results from Android lint. At the moment I am launching lint from the command line and saving the results to an XML file that can then be read by Jenkins. What I can't seem to do though is ignore library projects. In Eclipse you can explicitly disable scanning of library projects but I can't figure out if there is a corresponding command line argument for this.
I have come up with a few different work-arounds for this issue but none of them are ideal. I am using lint 22.0.5. Thanks.
I would first try to compare the lint configuration files when modified by eclipse to see if you find out what eclipse does. Maybe there's a way to modify the lint.xml file see to achieve what you want this or that
In other words, backup your project, modify your eclipse config, save and compare with backup.
Here's a modified lint.xml that could be useful for your particular case, but it looks like it was done manually.
If you don't find anything useful, an alternative solution is to filter out the logs coming those paths:
Android Lint report for my project only, excluding library projects?
This is how I do it with Jenkins and Gradle:
- Configure the Jenkins post-build action "Publish Android Lint Results" to pick up only the lint-results.xml of the main project. The default is **/lint-results.xml and includes lint results of library projects.
- Set
abortOnError false
in the build.gradle file in library projects to ignore lint errors there.
Put this in lint.xml
in project root directory:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="all">
<ignore path="path_to_library/**" />
</issue>
</lint>
来源:https://stackoverflow.com/questions/18384143/ignoring-library-project-with-android-lint-on-the-command-line