Skip to content

Instantly share code, notes, and snippets.

@btforsythe
Created August 25, 2017 23:27
Show Gist options
  • Save btforsythe/7f5d68eaa94a2fd04828b1b15900c123 to your computer and use it in GitHub Desktop.
Save btforsythe/7f5d68eaa94a2fd04828b1b15900c123 to your computer and use it in GitHub Desktop.
Creating src directories with Groovy combinations()
def dirElements = [['src'],['main', 'test'],['java', 'resources']].combinations()
println "elements are $dirElements"
dirElements.each {
def dir = new File(it.join(File.separator))
println "checking for $dir"
if(!dir.exists()) {
dir.mkdirs()
println "created $dir"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment