gradle-watch-plugin icon indicating copy to clipboard operation
gradle-watch-plugin copied to clipboard

Using from separate file

Open djKianoosh opened this issue 10 years ago • 0 comments

Cool plugin. Thanks!

I'm not sure if this is the 'gradle way', but if I wanted to configure this in a separate file, this is what I have to do:

in build.gradle:

apply from: 'watch.gradle'

and in watch.gradle:

import com.bluepapa32.gradle.plugins.watch.WatchPlugin

buildscript {
    repositories {
        maven {
            url "...internal maven repo..."
        }
        jcenter()
    }
    dependencies {
        classpath 'com.bluepapa32:gradle-watch-plugin:0.1.4'
    }
}

apply plugin: WatchPlugin

watch {
    custom {
        files files('src/main/static')
        tasks 'applicationJavascript'
    }
}

If you notice, I had to import the WatchPlugin class and apply it that way. Not sure if this is an issue you need to worry about, but in case people wanted to separate out this config... is there a better way? or a more idiomatic gradle way?

djKianoosh avatar Feb 18 '15 15:02 djKianoosh