/*
 * Copyright 2021 DataCanvas
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

plugins {
    id 'java'
    id 'checkstyle'
}

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(8))
    }
}

checkstyle {
    ignoreFailures = false
    //maxWarnings = 0
}

repositories {
    mavenLocal()
    mavenCentral()
}

dependencies {
    // facilities
    compileOnly 'org.projectlombok:lombok:' + 'lombok'.v()
    annotationProcessor 'org.projectlombok:lombok:' + 'lombok'.v()
    testCompileOnly 'org.projectlombok:lombok:' + 'lombok'.v()
    testAnnotationProcessor 'org.projectlombok:lombok:' + 'lombok'.v()
    // testing
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:' + 'junit5'.v()
    testImplementation 'org.junit.jupiter:junit-jupiter-api:' + 'junit5'.v()
    testImplementation 'org.junit.jupiter:junit-jupiter-params:' + 'junit5'.v()
    testImplementation group: 'org.assertj', name: 'assertj-core', version: 'assertj'.v()
    // logging
    implementation 'org.slf4j:slf4j-api:' + 'slf4j'.v()
    // testImplementation 'org.slf4j:slf4j-simple:' + 'slf4j'.v()
    // static check
    checkstyle 'com.puppycrawl.tools:checkstyle:' + 'checkstyle'.v()
    //compileOnly 'com.google.code.findbugs:jsr305:' + 'jsr305'.v()
    compileOnly 'org.checkerframework:checker-qual:' + 'checkerframework'.v()
    //testCompileOnly 'com.google.code.findbugs:jsr305:' + 'jsr305'.v()
    testCompileOnly 'org.checkerframework:checker-qual:' + 'checkerframework'.v()
}

test {
    useJUnitPlatform()
}
