xvik / gradle-quality-plugin

Gradle quality plugin for Java and Groovy
http://xvik.github.io/gradle-quality-plugin
MIT License
134 stars 11 forks source link

Add an ability to exclude sources from analysis #2

Closed baev closed 7 years ago

xvik commented 7 years ago

I assume that you want something like this:

quality {
    exclude  = [
               '**/com/mypackage/badcode/**'
    ]
}

Is it correct? If not please show your example.

baev commented 7 years ago

yep, that is correct in general. My sourceSet contains two folders build/generated-sources and src/main/java (and I can split them to different source sets for some reason). So it would be nice to exclude generated sources from analysis (generated sources is in the same package and may contains a lot of classes)

baev commented 7 years ago

@xvik is there any chance to get this implemented soon?

xvik commented 7 years ago

It's already implemented but needs some polishing before publication. The new version should be released in a couple of days.

baev commented 7 years ago

@xvik glad to hear, thanks

xvik commented 7 years ago

Released 2.2.0

I suppose your configuration is something like this:

sourceSets.main {
    java {
        srcDir 'build/generated-sources'
    }
}

So to exclude all generated classes you can use:

quality {
    excludeSources = fileTree('build/genearted-sources')
}

See full description in the new docs chapter

baev commented 7 years ago

thank you so much