I needed a custom lint rule, so created one using the steps from here
All is working ok, the custom rule is now checked by lint. However, I have added the custom rule .jar to /.android/lint
path. But this means that this rule is checked only for me locally.
The location of the .android directory is typically the home directory; lint will search in $
ANDROID_SDK_HOME
, in${user.home}
(the Java property), and in$HOME
. (Somebody asked about this; Lint basically calls the general Android tools method to find the "tools settings directory", used for emulator snapshots, ddms configuration, etc. You can find the relevant code for that here: https://android.googlesource.com/platform/tools/base/+/master/common/src/main/java/com/android/prefs/AndroidLocation.java )
How can I add the .jar file to the project such that all the people working on it will have this lint rule checked? Searched for an answer but didn't find any clues...
The new AAR format allows to compile and bundle custom lint rules which is perfect for distributed working OR CI environments, like mentioned here [1].
Another suitable solution is to have your custom lint rule as module/project dependency within your application project.
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