Create many sourceSets in Gradle

I have a project in which there are folder with different zip archives. I want to extract them and for each to make some checks. But want reports to be separated. For example pmd check. So to be separated files from each zip file has to be but in different sourseSets and when call

gradle check

For each of the dirs to generate reports with the checks.

Input files:,,, Each of the zip contains separate project. for example:


.... When run checks to be generated


So I want to declare this different sourceSets according the name of the zips and not to do it manually, but don't know how.

sourceSets {
        java {
            srcDirs  file("...")

Is there are another easy way to separated checks without creating new sourceSets for each zip?


one way to start you could create dedicated tasks for each zip. This can be done in a loop:

["source1", "source2", "source3"].each{ sourceName ->
    tasks.create("pmd${sourceName}", Pmd){
        reports.html.reportsDir = "$buildDir/reports/pmd${sourceName}"

        source = zipTree("file/to/$")


Need Your Help

Load Fragment before Navigation Drawer closes

android android-fragments navigation

I have implemented a navigation drawer and I want to load my fragment before the navigation drawer closes. Currently, the fragment loads in parallel with the drawer closing, so if the fragment is h...

Making hibernate ignore normal get methods

hibernate methods mapping field

I have an application that was mapped using fields, so after reading about it I have decied to move to methods. However now I have a problem where in one of my abstract class that has method getFul...