jruby-gradle-plugin/jruby-gradle-jar-plugin
R. Tyler Croy 204cd4071d
Ensure that the shadow plugin code will be loaded in the classpath for gradleTest
2015-10-01 07:12:48 -07:00
..
gradle Ensure that the shadow plugin code will be loaded in the classpath for gradleTest 2015-10-01 07:12:48 -07:00
src Generate .jrubydir files when the JRubyJar task is copying files into the archive 2015-10-01 07:12:35 -07:00
.gitignore Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00
.travis.yml Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00
CHANGELOG.md Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00
LICENSE Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00
README.adoc Update versions references in docs 2015-08-08 12:23:18 -07:00
appveyor.yml Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00
build.gradle Generate .jrubydir files when the JRubyJar task is copying files into the archive 2015-10-01 07:12:35 -07:00
gradlew Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00
gradlew.bat Add 'jruby-gradle-jar-plugin/' from commit 'dfd68a16f189c48fe056d6add4c7fed2b9381611' 2015-06-06 11:48:35 -07:00

README.adoc

<html lang="en"> <head> </head>
Build Status
download

Getting Started

Compatibility

This plugin requires link::http://gradle.org[Gradle] 2.0 or better

Installing

build.gradle
buildscript {
    repositories { jcenter() }

    dependencies {
        /* check jruby-gradle.org for the latest release */
        classpath "com.github.jruby-gradle:jruby-gradle-jar-plugin:1.0.1"
    }
}

apply plugin: 'com.github.jruby-gradle.jar'

Implicitly loaded plugins

Currently, the jar plugin only depends on the base plugin of the same version as the jar plugin and the java-base plugin included with your version of Gradle.

Tasks

JRubyJar

build.gradle
jrubyJar {
    // Use the default GEM installation directory
    defaultGems()

    // Add this GEM installation directory to the JAR.
    // Can be called more than once for additional directories
    gemDir '/path/to/my/gemDir'

    // Equivalent to calling defaultGems()
    defaults 'gem'

    // All methods and properties from `Jar`
}

Types of jars

Runnable Jars

build.gradle
jrubyJar {
    // tell the plugin to pack a runnable jar
    initScript runnable()

    // Use the default bootstrap class (can be omitted)
    defaultMainClass()

    // Includes the default gems to the jar (can be omitted)
    defaultGems()

    // Make the JAR executable by supplying your own main class
    mainClass 'my.own.main'

    // Equivalent to calling defaultMainClass() and defaultGems()
    defaults 'gems', 'mainClass'
}

Library Jars

A library jar isnt really much more than a container which includes the configured gems and jar dependencies inside of the packaged .jar file.

build.gradle
jrubyJar {
    // tell the plugin to pack a runnable jar (no bootstrap script)
    initScript library()

    // Includes the default gems to the jar (can be omitted)
    defaultGems()

    // Equivalent to calling defaultGems()
    defaults 'gems'
}
</html>