-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
145 lines (122 loc) · 2.79 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
buildscript {
configurations.classpath {
resolutionStrategy.activateDependencyLocking()
}
}
plugins {
id('checkstyle')
id('java-gradle-plugin')
alias(libs.plugins.pluginPublish)
alias(libs.plugins.prettyJupiter)
alias(libs.plugins.sonarlint)
alias(libs.plugins.strictNullCheck)
}
group = 'io.github.joselion'
java {
sourceCompatibility = JavaLanguageVersion.of(17)
toolchain {
languageVersion = JavaLanguageVersion.of(23)
vendor = JvmVendorSpec.ORACLE
}
}
javadoc {
options.addStringOption('Xdoclint:none', '-quiet')
}
tasks.withType(JavaCompile) {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
dependencyLocking {
lockAllConfigurations()
}
checkstyle {
setMaxWarnings(0)
setToolVersion(libs.versions.checkstyle.get())
}
sonarLint {
languages {
include('java')
}
rules {
enable(
'java:S4266', // "Stream.collect()" calls should not be redundant
)
disable(
'java:S107', // Allow constructors with more than 7 parameters
'java:S3776', // Allow methods with more than 15 lines
'java:S4032', // Allow packages only containing `package-info.java`
)
}
}
strictNullCheck {
addEclipse()
packageInfo.useEclipse()
}
repositories {
mavenCentral()
}
dependencies {
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
sonarlintCorePlugins(libs.sonarlint.java)
implementation(localGroovy())
implementation(libs.maybe)
}
testing {
suites {
configureEach {
useJUnitJupiter(libs.versions.junit.get())
dependencies {
annotationProcessor(libs.lombok)
compileOnly(libs.lombok)
implementation(libs.assertj)
implementation(libs.mockito)
}
}
testkit(JvmTestSuite) {
dependencies {
implementation(gradleTestKit())
}
targets {
configureEach {
testTask.configure {
shouldRunAfter(test)
}
}
}
}
}
}
prettyJupiter {
failure {
maxMessageLines = 30
}
duration {
customThreshold = [testkit: 1000]
}
}
gradlePlugin {
website = 'https://joselion.github.io/strict-null-check/'
vcsUrl = 'https://github.com/joselion/strict-null-check'
plugins {
strictNullCheck {
id = 'io.github.joselion.strict-null-check'
implementationClass = 'io.github.joselion.strictnullcheck.StrictNullCheckPlugin'
displayName = 'Strict Null Check Plugin'
description = 'A Gradle plugin to add full Strict Null Check to your Java code'
tags.set([
'nullability',
'strict-null',
'nonnull',
'null-check',
'non-null-by-default',
'package-info-generation',
'sonarlint'
])
}
}
testSourceSets(sourceSets.testkit)
}
tasks.named('check') {
dependsOn(testing.suites.testkit)
}