Android的皮棉启用与摇篮检查 [英] Android lint enable checks with gradle

查看:348
本文介绍了Android的皮棉启用与摇篮检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想执行的11个残疾检查。该的Andr​​oid林特文档刚才说的这个

  

有些检查默认情况下禁用。这些可以通过增加被启用   在 - 启用标志

我怎样才能激活他们为我的摇篮打造?我无法找到任何选项来做到这一点在 build.gradle lint.xml 文件。

解决方案

从的皮棉支持

  

随着0.7.0版本,可以运行皮棉特定变体,或   所有变型,在这种情况下,它产生一份报告,其中描述了   具体的变种一个给定的问题适用。

     

您可以通过添加lintOptions部分像下面配置皮棉。   您通常只指定了其中的一些;这部分显示了所有的   可用的选项。

 安卓{
    lintOptions {
        ...
        启用RtlHard codeD,RtlCompat','RtlEnabled
        ...
    }
 

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.

解决方案

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'
        ...
    }

这篇关于Android的皮棉启用与摇篮检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆