Code Monkey home page Code Monkey logo

gradle-capsule-plugin's Introduction

Capsule plugin for Gradle

Produces a Capsule jar matching java project's configuration.

A capsule is a single executable JAR that contains everything your application needs to run either in the form of embedded files or as declarative metadata.

Getting started

First, you have to declare the plugin at the top of your build script:

plugins {
  id 'com.jonaslasauskas.capsule'
}

It requires a repository to download Capsule base artifact. Declare mavenCentral(), jcenter(), or any other repository which contains co.paralleluniverse:capsule:*. For now let's use jcenter():

repositories {
  jcenter()
}

This plugin implicitly applies Java plugin and introduces a capsule task which will be executed on assemble.

capsule task will try to resolve any necessary properties, but in case they are not available you should declare them manually:

capsule {
  capsuleManifest {
    applicationId = 'your.application.id'
    applicationClass = 'your.package.MainApplicationClass'
  }
}

Here

applicationId: a unique name which usually follows Java's package naming convention (for more information see The Capsule ID section).

applicationClass: fully qualified name of the main class.

Furthermore, capsule extends from jar task which means it supports all jar properties and methods.

You are now ready to put your project into capsule:

$ ./gradlew assemble

If everything went well you will find a Capsule jar located in build/libs/. The new jar has capsule classifier. So if your project is named test, you will find build/libs/test-capsule.jar file which is an executable Capsule:

$ java -jar build/libs/test-capsule.jar

Contributing

Gradle Capsule Plugin is hosted on GitLab but there's a mirrored project repository on GitHub where contributions can be submitted as well.

Furthermore, there are a few guidelines which can be found in contributing guide.

gradle-capsule-plugin's People

Contributors

jonas-l avatar

Watchers

 avatar  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.