def pmdVersion = "5.8.0" // TODO: Update to PMD 6 def spotbugsVersion = "3.1.3" def jacocoVersion = "0.8.1" def errorproneVersion = "2.3.1" // Set up ErrorProne (currently only for JDK8, until JDK9 is supported) dependencies.errorprone "com.google.errorprone:error_prone_core:$errorproneVersion" tasks.withType(JavaCompile) { options.compilerArgs += ['-Xep:DefaultCharset:ERROR', '-Xep:ClassCanBeStatic:ERROR', '-Xep:StringEquality:ERROR', '-Xep:MethodCanBeStatic:WARN', '-Xep:RemoveUnusedImports:WARN', '-Xep:PrivateConstructorForUtilityClass:WARN', '-Xep:WildcardImport:WARN', '-Xep:LambdaFunctionalInterface:WARN', '-Xep:ConstantField:WARN'] } // Spotbugs config spotbugs { toolVersion = spotbugsVersion ignoreFailures = true effort = "max" reportLevel = "low" sourceSets = [sourceSets.main, sourceSets.test] } // JaCoCo config jacoco { toolVersion = jacocoVersion } jacocoTestReport { reports { xml.enabled = true html.destination file("$buildDir/reports/jacoco") } } build.dependsOn jacocoTestReport // PMD config pmd { toolVersion pmdVersion ignoreFailures true ruleSetConfig = resources.text.fromFile('config/pmd/ruleset.xml') sourceSets = [sourceSets.main, sourceSets.test] } // SonarQube config sonarqube { properties { property 'sonar.forceAuthentication', 'true' property 'sonar.host.url', 'https://sonarqube.com' property 'sonar.projectKey', 'org.openstreetmap.josm.plugins:Microsoft-Streetside' property 'sonar.projectName', 'ms-streetside-josm-plugin' property 'sonar.projectVersion', project.version property 'sonar.projectDescription', property('plugin.description') property 'sonar.sources', ['src'] } }