

def custom = { "$rootDir/gradle/${it}.gradle" } //find custom plugins locally


apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply from: custom('jacoco-version')
apply from: custom('jacoco-config')
apply from: custom('jacoco-excludes')

sourceCompatibility = 1.8
targetCompatibility = 1.8

jar {
    manifest {
        attributes 'Implementation-Title': 'cyclops', 'Implementation-Version': version
    }
}

repositories {
    mavenCentral()
    jcenter()
}



dependencies {


    api 'org.agrona:Agrona:0.9.1'
    api 'org.reactivestreams:reactive-streams:1.0.0'
    api 'io.kindedj:kindedj:'+kindedJVersion

    testImplementation group: 'io.projectreactor', name: 'reactor-test', version: '3.2.2.RELEASE'
    testImplementation 'com.github.stefanbirkner:system-rules:1.10.0'
    testImplementation 'io.projectreactor:reactor-core:3.2.2.RELEASE'
    testImplementation 'com.google.guava:guava:19.0'
    testImplementation 'org.reactivestreams:reactive-streams-tck:1.0.0'
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.hamcrest:hamcrest-all:1.3'
    testImplementation 'org.mockito:mockito-all:1.9.5'
    testImplementation 'io.javaslang:javaslang:2.0.2'
    testImplementation 'org.assertj:assertj-core:3.8.0'
    testImplementation(group: 'org.hibernate', name: 'hibernate-core', version: '5.1.0.Final')
    testImplementation (group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.1.0.Final')
    testImplementation group: 'org.hsqldb', name: 'hsqldb', version: '2.0.0'

    jmh 'com.github.akarnokd:ixjava:1.0.0-RC5'
    jmh 'io.vavr:vavr:0.9.2'
    jmh 'com.google.guava:guava:19.0'

}

/**
jacocoTestReport {
    afterEvaluate {
        classDirectories = files(classDirectories.files.collect {
            fileTree(dir: it, exclude: ['com/aol/cyclops2/util/stream/scheduling/cron/**'])
        })
    }
}
**/
jmh {
    jmhVersion = '1.29'
    humanOutputFile = null
  //  include = ".*scrabble*"
}

task testNG(type: Test) {
    useTestNG {}
    testLogging {
        events "started", "passed", "skipped", "failed"//, "standardOut", "standardError"
    }
    reports.html.destination = file("$buildDir/reports/test")
}


test {
    reports.html.destination = file("$buildDir/reports/test")
    forkEvery = 1
    testLogging {
        events "started", "passed", "skipped", "failed"//, "standardOut", "standardError"
    }
    minHeapSize = "512m" // initial heap size
    maxHeapSize = "1024m" // maximum heap size
    jvmArgs '-XX:MaxPermSize=256m' // mem argument for the test JVM

}

test {
    systemProperties 'property': 'value'
}
task packageTests(type: Jar) {
    from sourceSets.test.output
    classifier = 'tests'
}

artifacts.archives packageTests




