按包忽略所有lint警告错误

时间:2016-02-16 10:15:55

标签: android lint

我想忽略整个com包中的每个lint警告和错误。

lint documentation我只能看到如何使用pathregexp忽略特定文件和目录的某些问题。

如何忽略com包中的每个问题?

3 个答案:

答案 0 :(得分:1)

所以试试这个:

   <lint>
       <issue id="InvalidPackage">
          <ignore regexp="com.*" />
      </issue>
   </lint>

答案 1 :(得分:0)

您可以使用id="all"忽略所有棉绒警告,以下示例来自棉绒报告本身:

<!-- Ignore everything in the test source set -->
<issue id="all">
    <ignore path="*/test/*" />
</issue>

因此,在您的情况下,它与@MrZ的回复非常接近:

    <issue id="all">
        <ignore regexp="com.*" />
    </issue>

答案 2 :(得分:-4)

尝试使用以下

-keep class com.example.** {
    public protected private *;
 }
-dontwarn com.example.**
相关问题