Created
July 14, 2012 09:54
-
-
Save robpurcell/3110305 to your computer and use it in GitHub Desktop.
Minimal Gradle Build file for Groovy project creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'groovy' | |
apply plugin: 'idea' | |
task initProject(description: 'Initialize project directory structure.') << { | |
// Default package to be created in each src dir. | |
def defaultPackage = 'com/robbyp/greg' | |
['java', 'groovy', 'resources'].each { | |
// convention.sourceSets contains the directory structure | |
// for our Groovy project. So we use this struture | |
// and make a directory for each node. | |
sourceSets*."${it}".srcDirs*.each { dir -> | |
def newDir = new File(dir, defaultPackage) | |
logger.info "Creating directory $newDir" // gradle -i shows this message. | |
newDir.mkdirs() // Create dir. | |
} | |
} | |
} | |
task wrapper(type: Wrapper) { | |
gradleVersion = '1.0' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment