简体   繁体   中英

How to exclude a package from codenarc?

I am new to Gradle and Codenarc but I found no example showing how to exclude a package from codenarc reports.

For example, I have a groovy application that uses, for instance, the package myapp.main and myapp.legacy

I want all my ruleset applied to myapp.main but none to myapp.legacy. How can I accomplish that?

There are a couple of places where to look for such information:

  1. The Gradle User Guide , which has a chapter for each plugin.
  2. The Gradle Build Language Reference (specifically the CodeNarc task type).
  3. The samples in the full Gradle distribution.
  4. The Gradle forums .

According to 2., an include or exclude filter should do the trick. For example:

codenarcMain {
    exclude "myapp/legacy/**"
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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