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