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...
The lint.xml fileA configuration file that you can use to specify any lint checks that you want to exclude and to customize problem severity levels.
First, create a new project. Perform a Gradle sync. Then run lint: Analyze > Inspect Code; choose the whole project. Lint should now run, the Inspections View opens up, and in the bottom right corner a bubble tells you that lint has created a baseline file with the current issues.
lintOptions { abortOnError false } This means it will run lint checks but won't abort the build if any lint error found. By default, its true and stops the build if errors are found.
Now it's possible to do so:
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="all">
<ignore regexp="target/classes/com/actionbarsherlock/.*[.]class" />
</issue>
</lint>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With