bluepapa32 / gradle-watch-plugin

Gradle Watch Plugin
Apache License 2.0
117 stars 20 forks source link

Gradle Watch Plugin 0.1.5 Build Status

Run predefined tasks whenever watched file patterns are added, changed or deleted.

Requirements

Usage

To use the Watch plugin, include in your build script:

Example 1. Using the Watch plugin

build.gradle

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.bluepapa32:gradle-watch-plugin:0.1.5'
    }
}   

apply plugin: 'com.bluepapa32.watch'

Tasks

The Watch plugin adds the following tasks to the project.

Table 1. Watch plugin - tasks

Task name Depends on Type Description
watch - WatchTask Run predefined tasks whenever watched file patterns are added, changed or deleted.

Configuration

watch {

    java {
        files files('src/main/java')
        tasks 'compileJava'
    }

    resources {
        files fileTree(dir: 'src/main/resources',
                       include: '**/*.properties')
        tasks 'processResources'
    }

    hoge {
        files files('foo/bar', 'foo/boo/hoo.txt')
        tasks 'hogehoge', 'hugohugo'
    }
}