-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
98 lines (77 loc) · 1.81 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
plugins {
id "java"
id "checkstyle"
id "pmd"
id "com.github.spotbugs" version "5.0.13"
id "application"
}
repositories {
mavenCentral()
}
dependencies {
testImplementation(platform('org.junit:junit-bom:5.9.2'))
testImplementation('org.junit.jupiter:junit-jupiter')
compileOnly("com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}")
}
/**************
* PLUGINS SETUP
***************/
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(19))
}
}
checkstyle {
ignoreFailures = true
toolVersion "10.8.1"
}
pmd {
ignoreFailures = true
toolVersion = '6.55.0'
consoleOutput = true
ruleSets = []
ruleSetFiles = files("$projectDir/config/pmd/pmd-ruleset.xml")
reportsDir = file("$buildDir/reports/pmd")
}
spotbugs {
ignoreFailures = true
toolVersion = "4.7.3"
}
/***********
* TASK SETUP
************/
checkstyleMain {
source = 'src/main/java'
}
checkstyleTest {
source ='src/test/java'
}
run {
standardInput = System.in
}
// To run the program via Gradle, invoke the `run` task as follows.
// ./gradlew run -q --console=plain
test {
// Use JUnit 5
useJUnitPlatform()
// Always run tests, even when nothing changed.
dependsOn 'cleanTest'
// Show test results.
testLogging {
events "passed", "skipped", "failed"
}
}
// Generate the executable Jar (to be included in the Docker container)
task fatJar(type: Jar) {
manifest {
attributes 'Main-Class': 'it.uniba.app/App'
}
archiveBaseName = project.name + '-all'
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
project.tasks.getByName('build').dependsOn fatJar
/***********************
* MAIN CLASS DECLARATION
************************/
mainClassName = 'it.uniba.app/App'