-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
99 lines (81 loc) · 1.99 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
plugins {
id 'java'
id 'application'
id "com.github.spotbugs" version "6.1.3"
id 'pmd'
id 'checkstyle'
id "net.davidecavestro.gradle.jxr" version "0.2.1"
id 'com.github.ben-manes.versions' version '0.52.0' // see dependencyUpdates
}
group 'ch.uhlme'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation 'com.googlecode.ez-vcard:ez-vcard:0.12.1'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.4'
}
application {
mainClassName = 'Application'
}
java {
withJavadocJar()
withSourcesJar()
}
jar.dependsOn javadocJar
jar.dependsOn sourcesJar
compileJava {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
jar {
duplicatesStrategy = DuplicatesStrategy.WARN
manifest {
attributes 'Main-Class': 'ch.uhlme.Application'
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
}
spotbugs {
//noinspection GrFinalVariableAccess
ignoreFailures = false
}
pmd {
ignoreFailures = false
toolVersion = "6.48.0"
}
spotbugsMain {
reports {
// Only one report format is supported. Html is easier to read, so let's use that
// (xml is the one that's enabled by default)
xml.required = false
html.required = true
}
}
checkstyle {
toolVersion '10.12.5'
maxWarnings = 0
}
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return !stableKeyword && !(version ==~ regex)
}
check.dependsOn dependencyUpdates
dependencyUpdates {
rejectVersionIf {
isNonStable(it.candidate.version)
}
gradleReleaseChannel="current"
checkForGradleUpdate = true
outputDir = "build/reports"
reportfileName = "dependencyUpdates"
}