[34329] | 1 | def pmdVersion = "5.8.0" // TODO: Update to PMD 6
|
---|
| 2 | def spotbugsVersion = "3.1.3"
|
---|
| 3 | def jacocoVersion = "0.8.1"
|
---|
| 4 | def errorproneVersion = "2.3.1"
|
---|
[34317] | 5 |
|
---|
| 6 | // Set up ErrorProne (currently only for JDK8, until JDK9 is supported)
|
---|
| 7 | dependencies.errorprone "com.google.errorprone:error_prone_core:$errorproneVersion"
|
---|
| 8 | tasks.withType(JavaCompile) {
|
---|
| 9 | options.compilerArgs += ['-Xep:DefaultCharset:ERROR',
|
---|
| 10 | '-Xep:ClassCanBeStatic:ERROR',
|
---|
| 11 | '-Xep:StringEquality:ERROR',
|
---|
| 12 | '-Xep:MethodCanBeStatic:WARN',
|
---|
| 13 | '-Xep:RemoveUnusedImports:WARN',
|
---|
| 14 | '-Xep:PrivateConstructorForUtilityClass:WARN',
|
---|
| 15 | '-Xep:WildcardImport:WARN',
|
---|
| 16 | '-Xep:LambdaFunctionalInterface:WARN',
|
---|
| 17 | '-Xep:ConstantField:WARN']
|
---|
| 18 | }
|
---|
| 19 |
|
---|
| 20 | // Spotbugs config
|
---|
| 21 | spotbugs {
|
---|
| 22 | toolVersion = spotbugsVersion
|
---|
| 23 | ignoreFailures = true
|
---|
| 24 | effort = "max"
|
---|
| 25 | reportLevel = "low"
|
---|
| 26 | sourceSets = [sourceSets.main, sourceSets.test]
|
---|
| 27 | }
|
---|
| 28 |
|
---|
| 29 | // JaCoCo config
|
---|
| 30 | jacoco {
|
---|
| 31 | toolVersion = jacocoVersion
|
---|
| 32 | }
|
---|
| 33 | jacocoTestReport {
|
---|
| 34 | reports {
|
---|
| 35 | xml.enabled = true
|
---|
| 36 | html.destination file("$buildDir/reports/jacoco")
|
---|
| 37 | }
|
---|
| 38 | }
|
---|
| 39 | build.dependsOn jacocoTestReport
|
---|
| 40 |
|
---|
| 41 | // PMD config
|
---|
| 42 | pmd {
|
---|
| 43 | toolVersion pmdVersion
|
---|
| 44 | ignoreFailures true
|
---|
| 45 | ruleSetConfig = resources.text.fromFile('config/pmd/ruleset.xml')
|
---|
| 46 | sourceSets = [sourceSets.main, sourceSets.test]
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | // SonarQube config
|
---|
| 50 | sonarqube {
|
---|
| 51 | properties {
|
---|
| 52 | property 'sonar.forceAuthentication', 'true'
|
---|
| 53 | property 'sonar.host.url', 'https://sonarqube.com'
|
---|
| 54 | property 'sonar.projectKey', 'org.openstreetmap.josm.plugins:Microsoft-Streetside'
|
---|
| 55 | property 'sonar.projectName', 'ms-streetside-josm-plugin'
|
---|
| 56 | property 'sonar.projectVersion', project.version
|
---|
| 57 | property 'sonar.projectDescription', property('plugin.description')
|
---|
| 58 | property 'sonar.sources', ['src']
|
---|
| 59 | }
|
---|
| 60 | }
|
---|