Code Monkey home page Code Monkey logo

gradle-license3j-plugin's Introduction

Gradle Plugin for License3J

This plugin makes it easy, nay, trivial, to generate and distribute license keys using the open-source license3j library.

There are two plugins in this package:

  • org.anarres.license3j.keys - key generation only
  • org.anarres.license3j - key generation AND license generation

Caveats

You must use the org.anarres.mirrors.license3j fork in order to have consistent datetime handling. This plugin generates licenses in the format for that fork, not the mainstream.

org.anarres.license3j.keys

This creates a task generateLicenseKeys, which will generate a public-private key pair in build/license3j. No configuration is required but much is offered.

You should copy the generated keys to a location in your source tree (or elsewhere) and preserve them, so that you can check them in the normal license3j manner.

org.anarres.license3j

This applies org.anarres.license3j.keys and additionally creates a task generateLicense.

buildscript {
	repositories {
		mavenCentral()
	}
	dependencies {
		classpath 'org.anarres.gradle:gradle-license3j-plugin:1.0.2'
	}
}

apply plugin: 'org.anarres.license3j'

repositories {
	mavenCentral()
}

dependencies {
	implementation 'org.anarres.mirrors.license3j:license3j:3.1.0.2'
}

generateLicense {
	publicKeyFile rootProject.file('src/license/public.key')
	privateKeyFile rootProject.file('src/license/private.key')

	feature "customerName", project.name;
	feature "my-other-feature", "anything"
	issuedAt java.time.Instant.now()
	expiresAfterNow 30, 'DAYS'
}

This will create a license.dat as a resource in your built JAR, which may be loaded using license3j.

gradle-license3j-plugin's People

Contributors

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