apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'findbugs'
apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'jdepend'
apply plugin: 'pmd'

mainClassName = "com.giorgiosironi.gameoflife.EmbeddedJettyApplication"

version = '0.0.1'
jar {
    manifest {
        attributes 'Implementation-Title': 'Game Of Life',
                   'Implementation-Version': version,
                   'Main-Class': 'com.giorgiosironi.gameoflife.EmbeddedJettyApplication'
    }
}

war {
    from 'src/main/resources/static'
}

jettyRunWar {
    contextPath '/'
}

tasks.withType(FindBugs) {
    reports {
        xml.enabled = false
        html.enabled = true
    }
}

findbugs {
    effort 'max'
}

tasks.withType(JDepend) {
    reports {
        text.enabled = true
        xml.enabled = false
    }
}

repositories {
    jcenter()
}

dependencies {
    compile 'org.eclipse.jetty:jetty-server:9.2.14.v20151106'
    compile 'org.eclipse.jetty:jetty-servlet:9.2.14.v20151106'
    compile 'org.freemarker:freemarker:2.3.23'
    compile 'org.glassfish.jersey.containers:jersey-container-grizzly2-http:2.22.1'
    compile 'org.glassfish.jersey.containers:jersey-container-jetty-http:2.22.1'
    compile 'org.glassfish.jersey.containers:jersey-container-servlet-core:2.22.1'
    compile 'org.glassfish.jersey.ext:jersey-mvc:2.22.1'
    compile 'org.glassfish.jersey.ext:jersey-mvc-freemarker:2.22.1'
    
    compile 'org.slf4j:slf4j-api:1.7.12'
    compile 'org.apache.logging.log4j:log4j-api:2.5'
    compile 'org.apache.logging.log4j:log4j-core:2.5'
    compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.5'

    testCompile 'junit:junit:4.12'
    testCompile 'org.seleniumhq.selenium:selenium-server:2.48.2'
    testCompile 'org.mockito:mockito-core:1.+'
    testCompile 'com.pholser:junit-quickcheck-core:0.6-alpha-2'
    testCompile 'com.pholser:junit-quickcheck-generators:0.6-alpha-2'
}
