/*
 * Copyright (C) 2015 AppTik Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: 'java'

compileJava {
    sourceCompatibility = 1.8
    targetCompatibility = 1.8
}
dependencies {
    compile project(':jus-java')
    compile project(':rx-jus')
    compile project(':retro-jus')
    compile project(':converter:jus-jjson')
    compile rootProject.ext.gson
}

javadoc {
    options.charSet = 'UTF-8'
    options.docEncoding = 'UTF-8'
    options.encoding = 'UTF-8'
}


task getEasyBeer() {
    //println System.getProperty("java.home")
    dependsOn assemble, compileJava
    doFirst{
        println(" ****** Getting easy beer ****** ")
    }
    doLast {
        javaexec {
            main = "io.apptik.comm.jus.examples.EasyJus"
            classpath = sourceSets.main.runtimeClasspath
            args = ['beer']
        }
    }
}

task getRxBeerHub() {
    //println System.getProperty("java.home")
    dependsOn assemble, compileJava
    doFirst{
        println(" ****** Getting reactive beer hub ****** ")
    }
    doLast {
        javaexec {
            main = "io.apptik.comm.jus.examples.RxJava1HubJus"
            classpath = sourceSets.main.runtimeClasspath
            args = ['beer']
        }
    }
}

task getRxBeer() {
    //println System.getProperty("java.home")
    dependsOn assemble, compileJava
    doFirst{
        println(" ****** Getting reactive beer ****** ")
    }
    doLast {
        javaexec {
            main = "io.apptik.comm.jus.examples.RxSimpleJus"
            classpath = sourceSets.main.runtimeClasspath
            args = ['beer']
        }
    }
}

task getFullRxBeer() {
    //println System.getProperty("java.home")
    dependsOn assemble, compileJava
    doFirst{
        println(" ****** Getting full reactive beer ****** ")
    }
    doLast {
        javaexec {
            main = "io.apptik.comm.jus.examples.RxFullJus"
            classpath = sourceSets.main.runtimeClasspath
            args = ['beer']
        }
    }
}

task getCustomBeer() {
    dependsOn assemble, compileJava
    doFirst{
        println(" ****** Getting custom beer ****** ")
    }
    doLast {
        javaexec {
            main = "io.apptik.comm.jus.examples.CustomJus"
            classpath = sourceSets.main.runtimeClasspath
            args = ['beer']
        }
    }
}

task getRetroBeer() {
    dependsOn assemble, compileJava
    doFirst{
        println(" ****** Getting retro beer ****** ")
    }
    doLast {
        javaexec {
            main = "io.apptik.comm.jus.examples.RetroJus"
            classpath = sourceSets.main.runtimeClasspath
            args = ['beer']
        }
    }
}