-
Notifications
You must be signed in to change notification settings - Fork 578
/
build.gradle
69 lines (57 loc) · 1.91 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
apply from: "$rootDir/gradle/checkstyle.gradle"
apply from: "$rootDir/gradle/jacoco.gradle"
ext {
log4jVersion = '2.17.2'
}
dependencies {
implementation(project(':spotbugs')) {
transitive = true
}
// These annotations are repackaged to spotbugs.jar, to keep backward compatibility for Ant task.
// If they're not repackaged, Ant task will report 'java.lang.ClassNotFoundException: edu.umd.cs.findbugs.annotations.CleanupObligation'
api project(':spotbugs-annotations')
implementation project(':spotbugsTestCases')
implementation project(':test-harness')
implementation 'junit:junit:4.13.2'
implementation 'org.hamcrest:hamcrest-all:1.3'
implementation 'org.apache.ant:ant:1.10.12'
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:$log4jVersion"
implementation 'com.google.errorprone:error_prone_annotations:2.13.1'
implementation files(project(":spotbugs").sourceSets.gui.output)
}
java {
withSourcesJar()
}
tasks.named('compileJava', JavaCompile).configure {
options.release = 11
}
artifacts {
archives sourcesJar
}
tasks.named('jacocoTestReport', JacocoReport).configure {
dependsOn('unstableTest')
additionalSourceDirs.setFrom files(project(':spotbugs').sourceSets.main.java.srcDirs)
additionalClassDirs.setFrom files(project(':spotbugs').sourceSets.main.output.classesDirs)
executionData.setFrom files("$buildDir/jacoco/unstableTest.exec", "$buildDir/jacoco/test.exec")
}
// Tests below fail if executed with other tests
// So we run them before all other tests are executed
task unstableTest(type: Test) {
filter {
includeTestsMatching "PlaceholderTest"
includeTestsMatching "MutableClassesTest"
}
testLogging {
events "passed", "skipped", "failed"
}
}
test {
dependsOn ':spotbugsTestCases:build', 'unstableTest'
filter {
excludeTestsMatching "PlaceholderTest"
excludeTestsMatching "MutableClassesTest"
}
}
spotbugs {
ignoreFailures = true
}