Contains useful Gradle plug-ins
Groovy
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
com.vogella.gradle.plugin.asciidoc
.gitignore
README.adoc
copyright.adoc

README.adoc

Vogella Gradle Plugins

This repository is used to provide custom Gradle plugins crafted by the vogella guys

Vogella AsciiDoctor Plugin

This Gradle Plugin makes use of the http://asciidoctor.org/docs/asciidoctor-gradle-plugin/ in order to create new tutorials on vogella.com

Get the Plugin

The root build.gradle file can look like this:

buildscript {
	repositories {
		mavenLocal()
		jcenter()
		maven{ url 'https://dl.bintray.com/vogellacompany/Gradle-AsciiDoctor-Plugin/' }
	}
	dependencies {
		classpath 'com.vogella.gradle:com.vogella.gradle.plugin.asciidoc:0.1.0'
	}
}

subprojects {
	apply plugin: 'com.vogella.gradle.plugin'
}

Create a new tutorial

  1. Create a new project(a sub-directory) in the root directory

  2. Add the new project to the settings.gradle file (include '{newProjectName}')

  3. Open new project in terminal and run ../gradlew cT to run the createTemplate task

When using the createTemplate task a userName property can be specified in the ~/.gradle/gradle.properties file, so that the copyright header directly contains the proper name.

How to build

In the root directory the following commands can be used to build different outputs.

// create HTML 5
./gradlew cH

// create PDF
./gradlew cP

// create EPub 3
./gradlew cE

// create All (HTML 5, PDF, EPub 3)
./gradlew cA

If these commands are run in the root directory all subprojects will be build.

Tip
Single subprojects can be build when navigating into a subproject and for example run ../gradlew cH
Note
On Windows OS ./gradlew.bat must be used
See Gradle tutorial

How to deploy this plugin to Bintray

// upload this plugin to bintray
./gradlew bintrayUpload

To publish this plugin you need a Bintray account that is part of the Bintray organization vogellacompany.

For the upload a bintrayUser and a bintrayApiKey property has to be set in the gradle.properties file.

The gradle.properties file can usually be found in the user home’s .gradle folder and could look similar to this:

org.gradle.daemon=true
userName=Simon Scholz

bintrayUser=simon-scholz
bintrayApiKey=7aab22ddfa6f78b71651ef503f2a8356bb268526

As an alternative a BINTRAY_USER and a BINTRAY_API_KEY can be set as system property.

In order to test this plugin it can also be published to a local maven repository.

// deploy the plugin to a local maven repo
./gradlew publishToMavenLocal