apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'

// compiler options
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

mainClassName = 'app.BenchmarkMain'

repositories {
    mavenCentral()

    //snapshot repository - not actually needed to run this example
    maven {
        url 'http://oss.sonatype.org/content/repositories/snapshots'
    }
}

dependencies {
    // Framework
    def framework_version = '0.9.10'
    compile "net.javapla.jawn:jawn:${framework_version}"


    // Database
    compile 'org.postgresql:postgresql:42.1.4'

    //Logging
    runtime group: 'ch.qos.logback', name: 'logback-classic', version: '1.1.3' exclude group: 'org.slf4j'
}

/* ****************** */
/*    Application     */
/* ****************** */
run {
    if(project.hasProperty('args')){
        args project.args.split(',')
    }
    jvmArgs = ['-XX:+UseParallelGC','-XX:+AggressiveOpts']//['-XX:+UseNUMA','-XX:+UseParallelGC','-XX:+AggressiveOpts']
}
applicationDistribution.from("webapp") {
    into "webapp"
}

/* ****************** */
/*    Eclipse         */
/* ****************** */
eclipse {
    classpath {
        // we need the output dir to be the same as the one gradle uses when running Jetty
        // or else the dynamic loading does not apply
        defaultOutputDir = file('build/classes/main')
    }
}
