import org.apache.tools.ant.filters.*
apply plugin: 'war'
apply plugin: 'com.bmuschko.tomcat'

description = 'CloudUnit Manager'
dependencies {
  compile project(':cu-core')
  compile project(':cu-docker-api')
    compile group: 'org.springframework', name: 'spring-webmvc', version:'4.3.0.RELEASE'
    compile group: 'org.springframework', name: 'spring-web', version:'4.3.0.RELEASE'
    compile group: 'org.springframework', name: 'spring-orm', version:'4.3.0.RELEASE'
    compile group: 'org.springframework', name: 'spring-aop', version:'4.3.0.RELEASE'
    compile group: 'org.springframework', name: 'spring-context-support', version:'4.3.0.RELEASE'
    compile group: 'org.springframework', name: 'spring-context', version:'4.3.0.RELEASE'
    compile(group: 'org.springframework.security', name: 'spring-security-web', version:'3.2.6.RELEASE') {
exclude(module: 'spring-asm')
    }
    compile group: 'org.springframework.security', name: 'spring-security-config', version:'3.2.6.RELEASE'
    compile(group: 'org.springframework.data', name: 'spring-data-jpa', version:'1.10.1.RELEASE') {
exclude(module: 'slf4j-api')
    }
    compile group: 'mysql', name: 'mysql-connector-java', version:'5.1.39'
    compile group: 'org.hibernate', name: 'hibernate-entitymanager', version:'5.1.0.Final'
    compile group: 'org.javassist', name: 'javassist', version:'3.19.0-GA'
    compile group: 'ch.qos.logback', name: 'logback-classic', version:'1.1.3'
    compile group: 'org.apache.openejb', name: 'commons-dbcp-all', version:'1.3'
    compile group: 'com.jayway.jsonpath', name: 'json-path', version:'2.2.0'
    compile group: 'javax.servlet', name: 'jstl', version:'1.2'
    compile group: 'javax.inject', name: 'javax.inject', version:'1'
    compile group: 'com.zaxxer', name: 'HikariCP', version:'2.4.5'
    compile group: 'com.jcraft', name: 'jsch', version:'0.1.50'
    compile group: 'org.postgresql', name: 'postgresql', version:'9.4.1210'
    compile group: 'org.freemarker', name: 'freemarker', version:'2.3.19'
    compile group: 'javax.mail', name: 'mail', version:'1.4.7'
    compile group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version:'3.0.3.201309161630-r'
    compile group: 'org.aspectj', name: 'aspectjweaver', version:'1.7.0'
    compile group: 'com.googlecode.json-simple', name: 'json-simple', version:'1.1.1'
    compile group: 'redis.clients', name: 'jedis', version:'2.9.0'
    compile group: 'org.springframework.data', name: 'spring-data-redis', version:'1.7.2.RELEASE'
    compile group: 'com.codahale.metrics', name: 'metrics-core', version:'3.0.1'
    compile group: 'com.codahale.metrics', name: 'metrics-graphite', version:'3.0.1'
    compile group: 'com.codahale.metrics', name: 'metrics-jvm', version:'3.0.1'
    compile group: 'com.codahale.metrics', name: 'metrics-servlet', version:'3.0.1'
    compile(group: 'com.codahale.metrics', name: 'metrics-servlets', version:'3.0.1') {
exclude(module: 'jackson-databind')
    }
    compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-hibernate4', version:'2.6.1'
    compile group: 'org.atmosphere', name: 'atmosphere-spring', version:'2.1.0-RC2'
    compile group: 'com.ryantenney.metrics', name: 'metrics-spring', version:'3.0.0-RC4'
    compile group: 'joda-time', name: 'joda-time', version:'2.3'
    compile group: 'org.gitlab', name: 'java-gitlab-api', version:'1.2.5'
    testCompile group: 'org.springframework', name: 'spring-test', version:'4.3.0.RELEASE'
    testCompile group: 'org.hibernate', name: 'hibernate-validator', version:'4.3.0.Final'
    testCompile group: 'org.springframework', name: 'spring-jms', version:'4.3.0.RELEASE'
    testCompile group: 'org.apache.activemq', name: 'activemq-broker', version:'5.13.3'
    testCompile group: 'org.springframework.amqp', name: 'spring-rabbit', version:'1.6.3.RELEASE'
    testCompile group: 'org.elasticsearch', name: 'elasticsearch', version:'0.90.9'
    testCompile group: 'org.mongodb', name: 'mongo-java-driver', version:'2.10.1'
    providedCompile group: 'javax.servlet', name: 'javax.servlet-api', version:'3.1.0'
    def tomcatVersion = '8.0.38'
    tomcat "org.apache.tomcat.embed:tomcat-embed-core:${tomcatVersion}",
            "org.apache.tomcat.embed:tomcat-embed-logging-juli:${tomcatVersion}",
            "org.apache.tomcat.embed:tomcat-embed-jasper:${tomcatVersion}"
}
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5'
    }
}

tomcatRun.contextPath = '/'
tomcatRunWar.contextPath = '/'



task vagrant {
    println "set vagrant profile"
    System.setProperty("spring.profiles.active", "vagrant")
}

processResources {
    filter ReplaceTokens, tokens: [
            "api.timestamp": project.property("api.timestamp")
    ]
}
