Skip to content

Instantly share code, notes, and snippets.

@hanbei
Created April 5, 2013 21:50
Show Gist options
  • Save hanbei/5322938 to your computer and use it in GitHub Desktop.
Save hanbei/5322938 to your computer and use it in GitHub Desktop.
A gradle task to create the initial project structure
apply plugin: 'java'
task initProject () << {
if (hasProperty(initPlugins)) {
initPlugins.split(',').each { plug -> project.apply { plugin(plug.trim()) } }
}
project.sourceSets*.allSource.srcDirTrees.flatten().dir.each { dir ->
dir.mkdirs()
}
}
call as
gradle initProject -PinitPlugins=java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment