66 lines
1.5 KiB
Groovy
66 lines
1.5 KiB
Groovy
plugins {
|
|
id "com.github.jruby-gradle.jar" version "0.1.2"
|
|
id "com.github.johnrengelman.shadow" version "1.1.2"
|
|
}
|
|
apply plugin: 'java'
|
|
|
|
import com.github.jrubygradle.JRubyExec
|
|
|
|
dependencies {
|
|
gems group: 'rubygems', name: 'protobuf', version: '3.0.+'
|
|
gems group: 'rubygems', name: 'concurrent-ruby', version: '0.7.+'
|
|
|
|
jrubyExec group: 'rubygems', name: 'rspec', version: '3.1.+'
|
|
jrubyExec group: 'rubygems', name: 'rspec-its', version: '1.+'
|
|
jrubyExec group: 'rubygems', name: 'pry', version: '0.10.+'
|
|
}
|
|
|
|
configurations {
|
|
jrubyExec {
|
|
extendsFrom gems
|
|
}
|
|
}
|
|
|
|
jrubyJavaBootstrap {
|
|
jruby {
|
|
initScript = 'blick-agent'
|
|
}
|
|
}
|
|
|
|
// Pull the contents of lib and bin into the root of the created jar file
|
|
sourceSets {
|
|
main {
|
|
resources.srcDirs = ['lib', 'bin']
|
|
}
|
|
}
|
|
|
|
shadowJar {
|
|
baseName 'blick-agent'
|
|
exclude '*.sw*', '*.gitkeep', '*.md'
|
|
jruby {
|
|
// Use the default GEM installation directory
|
|
defaultGems()
|
|
defaultMainClass()
|
|
}
|
|
}
|
|
|
|
task spec(type: JRubyExec) {
|
|
group 'JRuby'
|
|
description 'Execute the RSpecs in JRuby'
|
|
jrubyArgs '-S', 'rspec'
|
|
scriptArgs '--color', '--order', 'random'
|
|
}
|
|
|
|
// XXX: Currently this does not work properly because stdin is not being
|
|
// delegated properly
|
|
task console(type: JRubyExec) {
|
|
group 'JRuby'
|
|
description 'Execute a Pry-based console in JRuby'
|
|
jrubyArgs '-S', 'pry'
|
|
scriptArgs '-I', './lib'
|
|
standardInput System.in
|
|
standardOutput System.out
|
|
}
|
|
|
|
// vim: ft=groovy
|