Skip to content

Instantly share code, notes, and snippets.

@akiellor
Created August 18, 2011 03:14
Show Gist options
  • Save akiellor/1153213 to your computer and use it in GitHub Desktop.
Save akiellor/1153213 to your computer and use it in GitHub Desktop.
Gradle plugin to run rspec
apply plugin: 'java'
apply plugin: 'groovy'
configurations { rspec }
repositories {
mavenCentral()
}
dependencies {
rspec group: 'org.jruby', name: 'jruby-complete', version: '1.6.3'
}
task(gems, type: JavaExec) {
main = 'org.jruby.Main'
classpath = configurations.rspec
args = ['-S', 'gem', 'install', 'rspec']
environment['GEM_PATH'] = file('build/gems').path
environment['GEM_HOME'] = file('build/gems').path
}
task(spec, dependsOn: ["classes", "gems"], type: JavaExec) {
main = 'org.jruby.Main'
classpath = sourceSets.test.runtimeClasspath + configurations.rspec
args = ['-S', 'build/gems/bin/rspec', 'src/spec/ruby']
environment['GEM_HOME'] = file('build/gems').path
environment['GEM_PATH'] = file('build/gems').path
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment