-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
117 lines (94 loc) · 2.76 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
plugins {
id "com.github.hierynomus.license" version "0.15.0" apply false
}
allprojects {
apply plugin: 'idea'
}
subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'base'
apply plugin: 'checkstyle'
apply plugin: "com.github.hierynomus.license"
sourceCompatibility = '1.11'
targetCompatibility = '1.11'
version = '0.1-SNAPSHOT'
archivesBaseName = 'DIVE-Application'
repositories {
flatDir { dirs "lib", "$rootDir/lib" }
mavenCentral()
jcenter()
}
sourceSets {
main {
java {
srcDirs 'src'
}
resources {
srcDirs 'res'
}
}
test {
java {
srcDirs = ['test']
}
resources {
srcDirs = ['test-res']
}
}
}
dependencies {
implementation group: 'com.google.guava', name: 'guava', version: '27.1-jre'
implementation name: 'nonnull-runtime'
testImplementation 'junit:junit:4.12'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: '2.1'
testImplementation group: 'pl.pragmatists', name: 'JUnitParams', version: '1.1.1'
checkstyle group: 'com.puppycrawl.tools', name: 'checkstyle', version: '8.21'
}
tasks.withType(JavaCompile) {
options.fork = true
options.compilerArgs = ["-Werror", "-Xlint:unchecked", "-Xlint:rawtypes"]
options.debug = true
}
/*
* Tests now exclude acknowledged issues.
*/
test {
useJUnit {
excludeCategories 'edu.kit.iti.algover.KnownRegression'
}
}
/*
* Acknowledged issues can be tested separately.
* This task here records error but does not fail the build.
*/
task testKnownRegressions(type: Test) {
useJUnit {
includeCategories 'edu.kit.iti.algover.KnownRegression'
}
ignoreFailures=true
}
tasks.withType(Checkstyle) {
ignoreFailures=true
// doLast {
// reports.all { report ->
// def outputFile = report.destination
// if (outputFile.exists() && outputFile.text.contains("severity=\"error\"")) {
// throw new GradleException("There were checkstyle errors! For more info check $outputFile")
// }
// }
// }
reports {
xml.enabled true
}
}
license {
ext.year = Calendar.getInstance().get(Calendar.YEAR)
header file("$rootDir/HEADER")
include "$projectDir/src/**/*.java"
exclude "$projectDir/gen/**/*.java"
mapping {
java = "SLASHSTAR_STYLE"
}
}
}