Our Android project is dependent on some external projects over which we do not have control. Therefore I’m trying to setup custom lint.xml file so we can add ignore rules for them. As starting scenario I tried to remove warnings from ActionBarSherlock (no offence Jake)
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="FloatMath">
<ignore path="app/target/classes/com/actionbarsherlock/*" />
</issue>
<issue id="DefaultLocale">
<ignore path="app/target/classes/com/actionbarsherlock/*" />
</issue>
<issue id="ViewConstructor">
<ignore path="app/target/classes/com/actionbarsherlock/*" />
</issue>
</lint>
with following command in
lint app --disable FloatMath,DefaultLocale,ViewConstructor --xml lint-result.xml
However produced report still included messages from ABS.
Update
I changed command to
lint --disable FloatMath,DefaultLocale,ViewConstructor --xml lint-result.xml app
Doesn’t make any change for Jenkins still produce same report no matter what is in ignore, however if run in command line it does ignores all issues listed after disable. I wish that there was simple way to say, hey ignore/exclude things in sort of way Maven does…
Once again answering my own question…
lint.xml looks now like this and it will ignore any ActionBarSherlock reports on ASB 4.2.0
Shell execution command that we now use is
PS: Please be aware that this will not remove all reports of excluded APKLIB like in this case ABS as so far there is no way to exclude reports to unused resources of R.class. On compile process R.class of linked library and your project do get merged and Lint has no way to know this. It does only see single R.class with some references that are not used and reports them.