Skip to content

Instantly share code, notes, and snippets.

@VadimKirilchuk
Forked from Dierk/build.gradle
Last active December 16, 2015 20:49
Show Gist options
  • Save VadimKirilchuk/5494883 to your computer and use it in GitHub Desktop.
Save VadimKirilchuk/5494883 to your computer and use it in GitHub Desktop.
Snippet to easily generate directory structure for java/groovy/etc multimodule projects.
subprojects {
apply plugin: 'java'
task makeDirs(description:'make all dirs for project setup') << {
def sources = [sourceSets.main, sourceSets.test]
sources*.allSource*.srcDirs.flatten().each { File srcDir ->
println "making $srcDir"
srcDir.mkdirs()
}
}
}
task wrapper(type:Wrapper, description:"create a gradlew") {
gradleVersion = '1.5'
}
@VadimKirilchuk
Copy link
Author

As simple as calling:

gradle makeDirs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment