Last active
December 16, 2015 07:39
-
-
Save johnrengelman/5400495 to your computer and use it in GitHub Desktop.
Building Grails 2.2.1 with Gradle, with Spock testing and Codenarc and some extra tasks to mimic Java/Groovy projects in Gradle
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
import org.grails.gradle.plugin.GrailsTask | |
apply plugin: 'grails' | |
grails { | |
grailsVersion '2.2.1' | |
} | |
buildscript { | |
repositories { | |
mavenCentral() | |
maven { | |
name 'Grails Artifactory' | |
url 'http://repo.grails.org/grails/repo' | |
} | |
} | |
dependencies { | |
classpath 'org.grails:grails-gradle-plugin:2.0.0-SNAPSHOT' | |
} | |
} | |
repositories { | |
mavenCentral() | |
maven { | |
name 'Grails Artifactory' | |
url 'http://repo.grails.org/grails/repo' | |
} | |
} | |
dependencies { | |
bootstrap "org.grails.plugins:tomcat:${grails.grailsVersion}" | |
compile 'org.grails.plugins:cache:1.0.1' | |
compile 'org.grails.plugins:codenarc:0.9' | |
runtime "org.grails.plugins:hibernate:${grails.grailsVersion}" | |
runtime 'org.grails.plugins:resources:1.1.6' | |
test "org.grails:grails-test:${grails.grailsVersion}" | |
test('org.grails.plugins:spock:0.7') { | |
exclude group: 'org.spockframework', module: 'spock-grails-support' | |
} | |
test 'org.spockframework:spock-grails-support:0.7-groovy-2.0' | |
} | |
task codenarcGrailsMain(type: GrailsTask) { | |
command 'codenarc' | |
} | |
task codenarcMain(type: CodeNarc, dependsOn: codenarcGrailsMain) { | |
codenarcGrailsMain.outputs.each { | |
outputs.file it | |
} | |
} | |
task codenarcGrailsTest(type: GrailsTask) << {} | |
task codenarcTest(type: CodeNarc, dependsOn: codenarcGrailsTest) { | |
codenarcGrailsTest.outputs.each { | |
outputs.file it | |
} | |
} | |
task classes(type: GrailsTask) { | |
command 'compile' | |
} | |
task build(dependsOn: [assemble, test]) << {} | |
test.dependsOn classes | |
assemble.dependsOn classes |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This doesn't appear to work with gradle 2.8.
What version of gradle did you use?