Android lint enable checks with gradle

跟風遠走 提交于 2019-12-22 00:13:38

问题


I want to execute some of the 11 disabled checks. The Android Lint documentation just said about this

Some checks are disabled by default. These can be enabled by adding the --enable flag.

How can I activate them for my gradle build? I can't find any options to do that within the build.gradle or lint.xml file.


回答1:


From Lint Support

As of version 0.7.0, you can run lint for a specific variant, or for all variants, in which case it produces a report which describes which specific variants a given issue applies to.

You can configure lint by adding a lintOptions section like following. You typically only specify a few of these; this section shows all the available options.

android {
    lintOptions {
        ...
        enable 'RtlHardcoded','RtlCompat', 'RtlEnabled'
        ...
    }


来源:https://stackoverflow.com/questions/28108809/android-lint-enable-checks-with-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!