简体   繁体   English

Android Lint使用Gradle启用检查

[英]Android lint enable checks with gradle

I want to execute some of the 11 disabled checks. 我要执行11项禁用检查中的一部分。 The Android Lint documentation just said about this Android Lint文档刚刚谈到了这一点

Some checks are disabled by default. 默认情况下禁用某些检查。 These can be enabled by adding the --enable flag. 这些可以通过添加--enable标志来启用。

How can I activate them for my gradle build? 如何激活我的gradle? I can't find any options to do that within the build.gradle or lint.xml file. 我在build.gradlelint.xml文件中找不到执行此操作的任何选项。

From Lint Support 来自Lint支持

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. 从0.7.0版开始,您可以为特定变体或所有变体运行lint,在这种情况下,它会生成一个报告,描述给定问题适用于哪些特定变体。

You can configure lint by adding a lintOptions section like following. 您可以通过添加lintOptions部分来配置lint,如下所示。 You typically only specify a few of these; 您通常只指定其中一些; this section shows all the available options. 本节显示所有可用的选项。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM