Home

Awesome

Aurora

Elegant Gradle projects for the JVM

Introduction

Aurora is a plugin for Gradle that quickly configures a JVM project hosted on GitHub, with optional support for several plugins:

Support for a plugin is enabled only if Aurora detects that such plugin has been applied to the project.

The supported languages are currently:

Aurora's goal is to reduce boilerplate configuration, by providing the following automatic features - enabled only when the related projects are available:

Tasks

generatePom: creates a Maven POM under build/mavenTemp

generateCustomStartupScripts: creates custom startup scripts for running the app using a suitable Java version

setupScaladoc: provides configuration in order to prevent a few warnings issued by Scaladoc

Task dependencies

Aurora introduces tasks and task dependencies - however, only if the necessary plugins have been applied when the aurora{} DSL block is run.

Tasks

Installation

At the very beginning of your build script, add:

buildscript {
    repositories {
        jcenter()

        maven {
            url 'https://dl.bintray.com/giancosta86/Hephaestus'
        }
    }

    dependencies {
        classpath 'info.gianlucacosta.aurora:aurora:CHOOSE_VERSION'
    }
}

To apply the plugin:

apply plugin: 'info.gianlucacosta.aurora'

Aurora can be applied before or after other plugins, but its aurora{...} DSL block must occur after every apply introducing a plugin referenced by Aurora.

NOTE: when using Aurora with a language plugin - such as scala or groovy, you'll most probably need to add a generatedCompile item to your dependencies block, usually referencing the same compiler library as compile - in particular:

Usage

Aurora will perform most of its configuration (excluding mainly repository and task declarations) when reaching its (mandatory) DSL block:

aurora {
    gitHubUser  = "<GitHub user id>"

    docTask = "javadoc" //or "groovydoc", or "scaladoc", ... OPTIONAL (it is inferred)

    commandLineApp = false //OPTIONAL. Default: false

    author {
        name = "<Author name>"
        email = "<Author's e-mail address>"
        url = "<Author's url - OPTIONAL>"
    }

    customStartupScripts = true //OPTIONAL. Default: true
    
    commandLineApp = false //OPTIONAL. Default: false

    bintray {
        user = "<Bintray API user id - OPTIONAL>"
        key = "<Bintray API key - OPTIONAL>"

        repo = "<Target repository on Bintray>"

        licenses = ['Apache-2.0'] //The strings should follow Bintray's conventions

        labels = ["testLabel1", "testLabel2"] //Tags following Bintray's conventions
    }

    /*
    This example makes Java 1.8.0_65 or later required to run the application.
     OPTIONAL - if missing, Aurora will inject the version of the JVM building the app
    */
    javaVersion {
      major = 1  //Default: 0
      minor = 8 //Default: 0
      build = 0 //Default: 0
      update = 65 //Default: 0
    }

    /*
    Execution arguments for both the JVM and the app. OPTIONAL (it defaults to empty lists)
    */
    runArgs {
      jvm = ["-ea"] //Arguments for the JVM. OPTIONAL (defaults to an empty list)

      app = ["Alpha", "Beta"] //Arguments for the app. OPTIONAL (defaults to an empty list)
    }
}

Settings

customStartupScripts: creates Aurora-specific startup scripts in lieu of the default ones provided by Gradle's application plugin. OPTIONAL - the default is true

javaVersion: used by the custom startup scripts to check that the required Java version (or later) is installed. If missing, the current JVM version will be chosen

runArgs: JVM- and app-related arguments. Please refer to the example configuration above for more details

Example projects

Aurora is employed in a wide variety of open source projects - both libraries and applications:

Further references