apply from: '../dependencyVersions.gradle'

allprojects {
    group = 'io.doov'
    version = "1.0-SNAPSHOT"
}

subprojects {

    repositories {
        mavenCentral()
    }

    apply plugin: 'java'
    apply plugin: 'java-library'
    apply plugin: 'idea'
    apply plugin: 'eclipse'
    apply plugin: 'jacoco'

    dependencies {
        constraints {
            api group: 'io.doov', name: 'doov-core', version: '1.0-SNAPSHOT'
            api group: 'io.doov', name: 'doov-assertions', version: '1.0-SNAPSHOT'
            api group: 'io.doov', name: 'doov-assertions-core', version: '1.0-SNAPSHOT'
            api group: 'org.assertj', name: 'assertj-core', version: assertjVersion
            api group: 'com.datastax.oss', name: 'java-driver-core', version: '4.7.2'
            api group: 'com.datastax.oss', name: 'java-driver-query-builder', version: '4.7.2'
            api group: 'commons-io', name:'commons-io', version: commonsIoVersion
            api group: 'org.openjdk.jmh', name: 'jmh-core', version: jmhVersion
            api group: 'org.openjdk.jmh', name: 'jmh-generator-annprocess', version: jmhVersion
            api group: 'org.jfree', name: 'jfreechart', version: jfreechartVersion

            api group: 'org.hibernate.validator', name: 'hibernate-validator', version: hibernateValidatorVersion
            api group: 'org.hibernate.validator', name: 'hibernate-validator-cdi', version: hibernateValidatorCdiVersion
            api group: 'org.glassfish', name: 'jakarta.el', version: jakartaElVersion
        }
        api group: 'org.apache.commons', name: 'commons-text', version: commonsTextVersion
        api group: 'com.google.guava', name: 'guava', version: guavaVersion
        testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: junitJupiterVersion
        testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: junitJupiterVersion
        testRuntimeOnly group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junitJupiterVersion
        testImplementation group: 'org.assertj', name: 'assertj-core', version: assertjVersion
        testImplementation group: 'org.mockito', name: 'mockito-core', version: mockitoCoreVersion
        testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: junitPlatformLauncherVersion
    }

    compileJava {
        sourceCompatibility = '11'
        targetCompatibility = '11'
    }

    tasks.withType(JavaCompile) {
        options.encoding = 'UTF-8'
        options.compilerArgs << '-proc:none'
    }

    test {
        useJUnitPlatform()
        testLogging {
            events "failed"
            exceptionFormat "full"
        }
    }

    jacoco {
        toolVersion = "0.8.7"
    }

    jacocoTestReport {
        reports {
            xml
            html
        }
    }

    check.dependsOn(jacocoTestReport)
}

wrapper {
    gradleVersion = '6.8.1'
    distributionType = Wrapper.DistributionType.ALL
}