blob: f82f37a045a16212422269b76cd7ec5b681419b5 [file] [log] [blame]
plugins {
id 'java'
id 'checkstyle'
id "com.github.jk1.dependency-license-report" version "1.14"
id 'com.github.sherter.google-java-format' version '0.9'
id "com.github.spotbugs" version "4.4.2"
id "com.jfrog.artifactory" version "4.15.2"
id "net.ltgt.apt" version "0.21"
id "net.ltgt.errorprone" version "1.2.1"
}
/*
* When you check a version of the library, place the date that you checked it next to the library.
* TODOs indicate who has context for the upgrade and any reasons it may be delayed, not necessarily
* who should perform it.
**/
ext.libVersions = [
// Core Libraries
"guava": "29.0-jre", // 22 June 2020
"guice": "4.2.3", // 22 June 2020
"autoValue": "1.7.4", // 2 August 2020
// Logging
"flogger": "0.5.1", // 22 June 2020
"floggerBackend": "0.5.1", // 25 June 2020
"logback": "1.2.3", // 16 January 2020
"slf4j": "1.7.30", // 16 January 2020
// Client Libraries
"httpClient": "4.5.12", // 22 June 2020
// Helper Libraries
"apacheCommonsValidator": "1.4.0", // 25 June 2020
// Build Utilities
"errorprone":"2.4.0", // 22 June 2020
"errorproneJavacVersion":"9+181-r4173-1", // 22 June 2020
"jacoco": "0.8.5", // 22 June 2020
"spotbugs": "4.0.4", // 22 June 2020
// Test
"junit": "4.13", // 22 June 2020
"mockito": "3.3.3", // 22 June 2020
"assertj": "3.16.1", // 26 June 2020
// Command Line Utility Libraries
"jcommander": "1.78", // 22 June 2020
// OpenAPI Libraries
"openapiParser": "1.0.1", // 23 June 2020
"openapiCore": "1.0.1", // 23 June 2020
// Json Libraries
"jsonSchemaValidator": "1.0.42" // 13 July 2020
]
allprojects {
apply plugin: 'checkstyle'
apply plugin: 'idea'
apply plugin: 'jacoco'
apply plugin: 'java'
apply plugin: "com.github.jk1.dependency-license-report"
apply plugin: 'com.github.sherter.google-java-format'
apply plugin: "com.github.spotbugs"
apply plugin: 'net.ltgt.apt-idea'
apply plugin: "net.ltgt.errorprone"
sourceCompatibility = 11
targetCompatibility = 11
googleJavaFormat {
toolVersion = '1.7'
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
checkstyle 'com.puppycrawl.tools:checkstyle:8.24'
errorproneJavac("com.google.errorprone:javac:${libVersions.errorproneJavacVersion}")
errorprone "com.google.errorprone:error_prone_core:${libVersions.errorprone}"
implementation "com.google.flogger:flogger:${libVersions.flogger}"
implementation "com.google.flogger:flogger-system-backend:${libVersions.floggerBackend}"
implementation "com.google.guava:guava:${libVersions.guava}"
implementation "com.google.inject:guice:${libVersions.guice}"
implementation "commons-validator:commons-validator:${libVersions.apacheCommonsValidator}"
}
checkstyle {
configFile = file("$rootDir/config/checkstyle/checkstyle.xml")
}
checkstyleMain {
logging.setLevel(LogLevel.LIFECYCLE)
}
checkstyleTest {
logging.setLevel(LogLevel.LIFECYCLE)
}
group 'com.apigee.security.oas'
version '1.0-SNAPSHOT'
spotbugs {
toolVersion = libVersions.spotbugs
excludeFilter = file("$rootDir/spotbugs-exclude.xml")
effort = "max"
reportLevel = "low"
}
tasks.withType(JavaCompile).configureEach {
options.errorprone {
disableWarningsInGeneratedCode = true
allDisabledChecksAsWarnings = true
error("Var")
disable("AndroidJdkLibsChecker")
disable("StaticOrDefaultInterfaceMethod")
disable("Java7ApiChecker")
excludedPaths = ".*/build/generated/.*" // Required due to https://github.com/google/error-prone/issues/1165
}
}
jacoco {
toolVersion = libVersions.jacoco
}
jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
html.enabled true
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.90
}
limit {
counter="BRANCH"
minimum = 0.90
}
}
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Werror"
}
}
licenseReport {
configurations = ['runtimeClasspath']
}
jacocoTestCoverageVerification.dependsOn jacocoTestReport
jacocoTestReport.mustRunAfter check
jacocoTestReport.mustRunAfter test
build.dependsOn jacocoTestReport
jacocoTestCoverageVerification.mustRunAfter build
}
subprojects {
apply plugin: 'distribution'
apply plugin: 'net.ltgt.apt'
idea {
module {
// Marks the already(!) added srcDir as "generated"
generatedSourceDirs += file('build/generated/sources/annotationProcessor/java')
}
}
build.dependsOn check
build.dependsOn distTar
}
defaultTasks 'build'