apply plugin: 'groovy'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'com.moowork.gulp'
// apply plugin: 'org.kordmap.gradle.livereload'

buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:1.2.4.RELEASE")
        classpath("io.spring.gradle:dependency-management-plugin:0.5.3.RELEASE")
        classpath("com.moowork.gradle:gradle-gulp-plugin:0.10")
        // classpath("org.kordamp.gradle:livereload-gradle-plugin:0.2.1")
    }
}

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenLocal()
    jcenter()
}

dependencies {
    compile localGroovy()

    compile("joda-time:joda-time:2.8.2")
    compile("org.springframework.boot:spring-boot-starter-web")
    compile("org.springframework.boot:spring-boot-autoconfigure")
    compile("org.springframework.boot:spring-boot-starter-thymeleaf")
    compile("org.springframework:spring-jdbc")
    compile("commons-io:commons-io:2.4")
    // compile("com.h2database:h2:1.4.187")

    testCompile("org.springframework.boot:spring-boot-starter-test")
}

task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

tasks.withType(Tar){
    extension = 'tar.gz'
    compression = Compression.GZIP
}

artifacts {
    archives sourcesJar
}

task integTest(type: Test) {
}

task wrapper(type: Wrapper) {
    gradleVersion = '2.7'
    // distributionUrl
}

gulp {
    // Set the directory where gulpfile.js should be found
    workDir = file("${project.projectDir}")

    // Whether colors should output on the terminal
    colors = true

    // Whether output from Gulp should be buffered - useful when running tasks in parallel
    bufferOutput = false
}

gulp_setup.dependsOn(["npmInstall"])
processResources.dependsOn("gulp_setup")

