/*==========================================================================
Copyright 2015 EPAM Systems

This file is part of Wilma.

Wilma is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

Wilma is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Wilma.  If not, see <http://www.gnu.org/licenses/>.
===========================================================================*/

// Common local repository info
ext.wilmaVersion=2.5

group = 'com.epam.wilma'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'checkstyle'
apply plugin: 'java'
apply plugin: 'jacoco'

if ( !hasProperty('buildNumber') ) {
    rootProject.ext.buildNumber = 'SNAPSHOT'
}
version = "$wilmaVersion" + '.' + "${rootProject.ext.buildNumber}"

repositories {
    mavenLocal()
    maven { url "https://repository.jboss.org/nexus/content/groups/public" }
    maven { url "https://repo.maven.apache.org/maven2" }
    maven { url "https://maven.scijava.org/content/repositories/public/" }
}

// Source and target info
sourceCompatibility = JavaVersion.VERSION_15
targetCompatibility = JavaVersion.VERSION_15

// checkstyle settings
// general checkstyle availability:  https://checkstyle.sourceforge.io/releasenotes.html
// compatibility with sonar https://docs.sonarqube.org/latest/instance-administration/plugin-version-matrix/
checkstyle.toolVersion = '8.40'  //should be at least 8.45.1
checkstyle.ignoreFailures = true
checkstyle.configFile = file("${rootDir}/config/checkstyle/checkstyle.xml")
checkstyle.configProperties = ['samedir' : "${rootDir}/config/checkstyle"]
tasks.withType(Checkstyle) {
    reports {
        xml.required = false
        html.required = true
        html.stylesheet resources.text.fromFile("${rootDir}/config/checkstyle/checkstyle-noframes-sorted.xsl")
    }
}

jacoco {
    toolVersion = "0.8.11"
}
jacocoTestReport {
    reports {
        xml.required
    }
}
test.finalizedBy jacocoTestReport
