-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
159 lines (133 loc) · 4.73 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
159 lines (133 loc) · 4.73 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
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
import net.ltgt.gradle.errorprone.CheckSeverity
import net.ltgt.gradle.errorprone.errorprone
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
plugins {
idea
java
checkstyle
id("io.quarkus").apply(false)
alias(libs.plugins.axionReleasePlugin)
alias(libs.plugins.errorPronePlugin)
alias(libs.plugins.jooqPlugin).apply(false)
}
description = "AboutBits PostgreSQL Operator"
scmVersion {
checks {
aheadOfRemote = true
snapshotDependencies = false
uncommittedChanges = false
}
releaseBranchNames = setOf("main")
releaseOnlyOnReleaseBranches = true
versionCreator("simple")
}
version = scmVersion.version
allprojects {
group = "it.aboutbits.postgresql"
version = rootProject.version
tasks.withType<Checkstyle>().configureEach {
dependsOn(":checkstyleExtractConfig")
reports {
html.required = false
xml.required = false
}
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "checkstyle")
apply(plugin = rootProject.libs.plugins.errorPronePlugin.get().pluginId)
java {
sourceCompatibility = JavaVersion.VERSION_25
targetCompatibility = JavaVersion.VERSION_25
toolchain {
languageVersion = JavaLanguageVersion.of(JavaVersion.VERSION_25.majorVersion)
vendor = JvmVendorSpec.AMAZON
}
}
val quarkusPlatformGroupId: String by rootProject
val quarkusPlatformArtifactId: String by rootProject
val quarkusPlatformVersion: String by rootProject
dependencies {
/**
* Quarkus
*/
// https://mvnrepository.com/artifact/io.quarkus.platform/quarkus-bom
implementation(enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}"))
// https://mvnrepository.com/artifact/io.quarkus.platform/quarkus-operator-sdk-bom
implementation(enforcedPlatform("${quarkusPlatformGroupId}:quarkus-operator-sdk-bom:${quarkusPlatformVersion}"))
/**
* NullAway
*/
errorprone(rootProject.libs.errorProne)
errorprone(rootProject.libs.nullAway)
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
options.errorprone {
check("NullAway", CheckSeverity.ERROR)
check("RequireExplicitNullMarking", CheckSeverity.ERROR)
option("NullAway:AnnotatedPackages", "it.aboutbits.postgresql")
option("NullAway:JSpecifyMode", "true")
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
testLogging {
exceptionFormat = TestExceptionFormat.FULL
info {
showStandardStreams = !providers.environmentVariable("CI").isPresent
events(
*listOfNotNull(
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.FAILED,
TestLogEvent.STANDARD_ERROR,
if (!providers.environmentVariable("CI").isPresent) TestLogEvent.STANDARD_OUT else null
).toTypedArray()
)
}
}
if (!project.hasProperty("createTestReports")) {
reports.html.required = false
reports.junitXml.required = false
}
filter {
if (project.hasProperty("excludeTests")) {
val excludePatterns = project.property("excludeTests").toString().split(",")
excludePatterns.forEach { pattern ->
excludeTestsMatching(pattern.trim())
}
}
}
}
}
val checkstyleConfig: Configuration by configurations.creating {
isCanBeConsumed = false
isCanBeResolved = true
}
dependencies {
/**
* AboutBits Libraries
*/
checkstyleConfig(libs.checkstyleConfig)
}
tasks.register<Copy>("checkstyleExtractConfig") {
description = "Extracts the AboutBits Checkstyle configuration from the classpath."
group = JavaBasePlugin.CHECK_TASK_NAME
from(zipTree(checkstyleConfig.singleFile)) {
include("checkstyle.xml", "checkstyle-suppressions.xml")
}
into(layout.projectDirectory.dir("config/checkstyle/"))
}
checkstyle {
toolVersion = libs.versions.checkstyle.get()
isShowViolations = true
configFile = rootProject.file("config/checkstyle/checkstyle.xml")
configProperties = mapOf(
"suppressionFile" to rootProject.file("config/checkstyle/checkstyle-suppressions.xml")
)
}