-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
75 lines (63 loc) · 1.8 KB
/
build.gradle
File metadata and controls
75 lines (63 loc) · 1.8 KB
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
plugins {
id "com.github.spotbugs" version "1.7.1"
}
allprojects {
apply plugin: "idea"
}
subprojects {
apply plugin: 'java'
apply plugin: 'checkstyle'
apply plugin: 'com.github.spotbugs'
apply plugin: 'pmd'
repositories {
jcenter()
}
dependencies {
checkstyle group: 'com.thomasjensen.checkstyle.addons', name: 'checkstyle-addons', version: '5.2.1'
compile 'edu.princeton.cs:algs4:1.0.3'
testImplementation('org.junit.jupiter:junit-jupiter:5.4.2')
}
sourceSets {
main.java.srcDirs = ["src"]
test.java.srcDirs = ["test"]
}
def configDir = "$rootProject.projectDir/config"
checkstyle {
toolVersion = "8.17"
configFile = file("$configDir/.checkstyle/checkstyle.xml")
configProperties = [
'suppressions': "$configDir/.checkstyle/suppressions.xml",
'baseDir' : rootDir,
]
ignoreFailures = true
}
spotbugs {
toolVersion = "3.1.3"
includeFilter = file("$configDir/.spotbugs/spotbugs.xml")
effort = "max"
reportLevel = "high"
ignoreFailures = true
}
pmd {
toolVersion = '6.12.0'
ruleSetFiles = files("$configDir/.pmd/pmd.xml")
ignoreFailures = true
}
task zip(type: Zip) {
from sourceSets.main.java
}
test {
useJUnitPlatform()
}
tasks.addRule("Pattern: run<ClassName>") { taskName ->
if (taskName.startsWith("run")) {
task(taskName, type: JavaExec) {
main = taskName.substring(3)
if (System.getProperty("args")) {
args = System.getProperty("args").split(",") as List
}
classpath = sourceSets.main.runtimeClasspath
}
}
}
}