A Gradle plugin for enabling LiveReload
Groovy
Switch branches/tags
Clone or download
Permalink
Failed to load latest commit information.
config
gradle
src
.gitignore
.travis.yml
LICENSE.txt
README.adoc
build.gradle
gradle.properties
gradlew
gradlew.bat

README.adoc

LiveReload Gradle Plugin

Build Status Coverage Status Apache License 2 download

The livereload-gradle-plugin enables LiveReload on a particular directory via livereload-jvm.

Installation

Use the following snippet inside a Gradle build file:

build.gradle
buildscript {
    repositories {
        jcenter()
    }

    dependencies {
        classpath 'org.kordamp.gradle:livereload-gradle-plugin:0.2.1'
    }
}

apply plugin: 'org.kordamp.gradle.livereload'

Usage

The plugin adds a new task named liveReload. This task exposes 2 properties as part of its configuration

port

used by the LiveReload Sever. Type: int. Default: 35729.

docRoot

the main directory from which files will be served. Type: String. Default build/livereload

You’d usually run the liveReload task in a separate shell as the server is kept alive until the gradle session is killed. Support for forking the JVM process and killing the server via a second command may be added in a future release.

Configuration

This plugin can be used in combination with any task that produces content that should be reload. In particular this plugin detects if the asciidoctor-gradle-plugin is installed, automatically configuring the outputDir of the asciidoctor task as the docRoot. This setting can be overridden by user input of course.