/*
 * Copyright (c) 2018. NanoString Technologies, Inc.
 */

plugins {
    id 'java'
    id 'application'
}

group 'com.nanostring'
version '0.0.1-SNAPSHOT'

sourceCompatibility = 1.8
targetCompatibility = 1.8

mainClassName = 'com.nanostring.pluto.scriptworker.Main'

ext {
    profile = project.hasProperty('profile') ? project.profile : 'dev'
}

repositories {
    mavenLocal()
    mavenCentral()
    maven { url "https://nexus.bedatadriven.com/content/groups/public" }
    maven { url 'http://ec2-18-233-224-170.compute-1.amazonaws.com:8080/repository/release/' }
}

dependencies {
    //security
    compile group: 'org.pac4j', name: 'spark-pac4j', version: '3.0.0'
    compile group: 'org.pac4j', name: 'pac4j-oidc', version: '3.8.3'
    compile group: 'com.nanostring', name: 'oidc-utils', version: '0.1.6'

    compile "com.nanostring:properties-loader:0.1.0"

    compile "com.sparkjava:spark-core:2.7.2"
    compile group: 'com.google.code.gson', name: 'gson', version: '2.8.2'
    compile group: 'com.google.inject', name: 'guice', version: '4.2.0'

    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.25'
    compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.9.1'
    compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.9.1'

    compile group: 'org.sql2o', name: 'sql2o', version: '1.6.0-RC3'
    compile group: 'org.postgresql', name: 'postgresql', version: '42.2.2'

    compile group: 'javax.validation', name: 'validation-api', version: '2.0.0.Final'
    compile group: 'org.hibernate.validator', name: 'hibernate-validator', version: '6.0.2.Final'
    compile group: 'org.hibernate.validator', name: 'hibernate-validator-annotation-processor', version: '6.0.2.Final'

    compile group: 'org.rosuda.REngine', name: 'Rserve', version: '1.8.1'

    compile "org.renjin:renjin-script-engine:0.9.2692"

    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
}

test {
    useJUnitPlatform()
}

jar {
    if (!'dev'.equalsIgnoreCase(profile))
        exclude('local.properties')

    from {
        (configurations.runtime).collect {
            it.isDirectory() || it.name.endsWith('.pom') ? it : zipTree(it)
        }
    }
    manifest {
        attributes("Main-Class": mainClassName )
    }
}
