import net.ltgt.gradle.errorprone.CheckSeverity

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "net.ltgt.gradle:gradle-errorprone-plugin:2.0.2"
    }
}

apply plugin: "net.ltgt.errorprone"

dependencies {
    errorprone("com.google.errorprone:error_prone_core:2.12.1")
}

tasks.withType(JavaCompile).configureEach {
    options.errorprone {
        disableWarningsInGeneratedCode = true
        excludedPaths = '.*/cc/mvdan/accesspoint/.*'
        check("CatchFail", CheckSeverity.OFF)
        check("ClassCanBeStatic", CheckSeverity.OFF)
        check("DateFormatConstant", CheckSeverity.OFF)
        check("DefaultCharset", CheckSeverity.OFF)
        check("FormatString", CheckSeverity.OFF)
        check("JavaLangClash", CheckSeverity.OFF)
        check("MissingCasesInEnumSwitch", CheckSeverity.OFF)
        check("MissingOverride", CheckSeverity.OFF)
        check("NonAtomicVolatileUpdate", CheckSeverity.OFF)
        check("OperatorPrecedence", CheckSeverity.OFF)
        check("StringSplitter", CheckSeverity.OFF)
        check("UnsynchronizedOverridesSynchronized", CheckSeverity.OFF)
    }
}
