GithubHelp home page GithubHelp logo

isabella232 / gradle-capsule-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from corda/gradle-capsule-plugin

0.0 0.0 0.0 220 KB

A Gradle plugin for Capsule, the packaging and deployment tool for JVM apps.

License: MIT License

Groovy 94.83% Shell 3.92% Java 1.24%

gradle-capsule-plugin's Introduction

gradle-capsule-plugin

A Gradle plugin for Capsule, the packaging and deployment tool for JVM apps.

Currently using capsule v1.0.3.

Adding the Plugin

This plugin requires Gradle 2.4 and above. Simply define the plugins at the top of your build script:

plugins {
  id "us.kirchmeier.capsule" version "1.0.2"
}

Gradle 2.0 to 2.3 were last supported with plugin version 1.0.0.

Quick Start

This plugin defines no tasks, but instead provides several task types for building your own tasks.

FatCapsule

The FatCapsule type embedds your application and all of its dependencies into one executable jar file:

task fatCapsule(type: FatCapsule) {
  applicationClass 'com.foo.HelloWorld'
}

Use it like so:

$ gradle fatCapsule

$ cd build/libs
$ ls
project.jar project-capsule.jar

$ java -jar project-capsule.jar
Hello World!

Without further configuration:

  • It obtains your project source from the jar task.
  • It will include all of the dependencies from the runtime dependency configuration.
  • It will have the capsule classifier in it's file name.

MavenCapsule

The MavenCapsule type embeds only your application. It will download dependencies when the user executes the capulse.

Under the hood, it uses the maven capsule, which caches dependencies after downloading them.

task mavenCapsule(type: MavenCapsule){
  applicationClass 'com.foo.CoolCalculator'
}

Without further configuration:

  • It obtains your project source from the jar task.
  • It will download at runtime all of the dependencies from the runtime dependency configuration.
  • It will have the capsule classifier in it's file name.

Configuration

Capsule allows you define attributes in your capsule to onfigure system properties, pass in arguments to your application, limit compatible JVM versions and more. You may configure these using the capsuleManifest block.

See also: Capsule: Manifest Attributes and Source: CapsuleManifest

task myCapsule(type:FatCapsule){
  applicationClass 'com.foo.FancyCalculator'

  capsuleManifest {
    systemProperties['log4j.configuration'] = 'log4j.xml'
    args = ['--very-fancy']
    minJavaVersion = '1.8.0'
  }
}

Documentation

More thorough documentation is available in DOCUMENTATION.md.

Support

If you run into any issues or have an enhancement idea, please file an issue.

If you have any questions, capsule or gradle related, please start a topic on the Google Group/Mailing List.

gradle-capsule-plugin's People

Contributors

danthegoodman avatar isbecker avatar jonas-l avatar mikea avatar npvincent avatar stigkj avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.