Skip to content

Instantly share code, notes, and snippets.

@moksamedia
Created April 28, 2013 04:45
Show Gist options
  • Select an option

  • Save moksamedia/5475917 to your computer and use it in GitHub Desktop.

Select an option

Save moksamedia/5475917 to your computer and use it in GitHub Desktop.

Revisions

  1. moksamedia created this gist Apr 28, 2013.
    15 changes: 15 additions & 0 deletions gistfile1.groovy
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@

    /*
    * Here we iterate over the directories found in the root directory of the
    * main project, and if the subdirectory contains a build.gradle file, it
    * is added to the main project as a subproject.
    */
    Closure discoverSubprojects = {
    def list = []
    rootDir.eachDir(){ dir ->
    dir.eachFileMatch({it == 'build.gradle'}, { list += [dir.name] })
    }
    list.toArray(new java.lang.String[0])
    }

    include discoverSubprojects()