jruby-gradle-plugin/jar-plugin
Uwe Kubosch 0a0ed7d428 Release 2.1.0-beta.2 and try publishing docs 2023-05-17 20:06:34 +02:00
..
gradle Restructured directories for simpler and shorter names 2019-05-05 15:35:34 +02:00
src Update copyright year from 2020 to 2023 2023-05-16 10:20:02 +02:00
CHANGELOG.md Restructured directories for simpler and shorter names 2019-05-05 15:35:34 +02:00
LICENSE Restructured directories for simpler and shorter names 2019-05-05 15:35:34 +02:00
README.adoc Remove all dependency on Torquebox (#388) 2019-12-19 23:28:05 +01:00
build.gradle Release 2.1.0-beta.2 and try publishing docs 2023-05-17 20:06:34 +02:00

README.adoc

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

Getting Started

Compatibility

This plugin requires link::http://gradle.org[Gradle] 4.9 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.1.4,2.0)"
    }
}

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 {
    /* All methods and properties from `Jar` */
    from 'app'
}

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()

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

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()
}
</html>