JRuby/Gradle

JRuby/Gradle is a collection of
Gradle plugins which make it easy to build, test,
manage and package Ruby applications. By combining the portability of
JRuby with Gradle’s excellent task and dependency
management, JRuby/Gradle provides high quality build tooling for
Ruby and Java developers alike.

Packaging some Ruby

buildscript {
repositories { jcenter() }
dependencies {
/* here to make sure that our dependencies get loaded in properly under
* GradleTest, this is NOT needed by end-users
*/
classpath 'com.github.jengelman.gradle.plugins:shadow:[1.2.2,2.0)'
/* Replace "%%VERSION%%" with the version of JRuby/Gradle you wish to
* use if you want to use this build.gradle outside of gradleTest
*/
classpath 'com.github.jruby-gradle:jruby-gradle-plugin:%%VERSION%%'
classpath 'com.github.jruby-gradle:jruby-gradle-jar-plugin:%%VERSION%%'
}
}
apply plugin: "com.github.jruby-gradle.jar"
repositories { jcenter() }
dependencies {
/* Using the built-in `jrubyJar` configuration to describe the
* dependencies our jrubyJar task will need, so the gem is properly
* included in the resulting .jar file
*/
jrubyJar "rubygems:colorize:0.7.7+"
jrubyJar 'org.slf4j:slf4j-simple:1.7.12'
}
jrubyJar {
/* We want to use this Ruby script as our start point when the jar executes
*/
initScript "${projectDir}/entrypoint.rb"
}