-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle
126 lines (104 loc) · 3.43 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
plugins {
id 'net.researchgate.release' version '3.0.2'
id "com.github.spotbugs" version "6.0.4" apply false
id "com.diffplug.spotless" version "6.23.3"
//applied only in specific subprojects, yet important to define globally
id "org.jetbrains.kotlin.jvm" version '1.9.21' apply false
id "org.jetbrains.kotlin.plugin.spring" version '1.9.21' apply false
id "io.spring.dependency-management" version "1.1.4" apply false
id "org.springframework.boot" version "3.1.8" apply false
id "com.github.davidmc24.gradle.plugin.avro" version "1.9.1" apply false
id "com.google.protobuf" version "0.9.4" apply false
}
allprojects {
apply plugin: 'java'
apply plugin: 'idea'
// apply plugin: 'jacoco'
apply plugin: 'com.github.spotbugs'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'maven-publish'
group 'com.github.pi2schema'
version project.version
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
spotless {
java {
target 'src/*/java/**/*.java'
toggleOffOn()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
prettier(['prettier': '3.0.3', 'prettier-plugin-java': '2.3.1'])
.config([
'parser' : 'java',
'tabWidth' : 4,
'printWidth': 120,
'plugins': ['prettier-plugin-java']
])
importOrder('', 'java', 'javax', '\\#')
}
}
repositories {
mavenCentral()
//confluent jars are found on mavencentral but pom descriptors are missing causing gradle to fail
maven { url 'https://packages.confluent.io/maven/' }
}
}
subprojects {
dependencies {
implementation 'ch.qos.logback:logback-classic:1.4.11'
testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.10.1'
testImplementation 'org.assertj:assertj-core:3.24.2'
testImplementation 'org.apache.commons:commons-lang3:3.14.0'
testImplementation 'org.awaitility:awaitility:4.2.0'
testImplementation 'org.mockito:mockito-core:5.8.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.8.0'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
// do not run spot bugs on test for the time being
spotbugsTest {
enabled false
}
spotbugs {
// https://github.com/spotbugs/spotbugs-gradle-plugin#readme
ignoreFailures = true // will not crash the build
}
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/pi2schema/pi2schema")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
from(components.java)
}
}
}
}
//task codeCoverageReport(type: JacocoReport) {
// executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
//
// subprojects.each {
// sourceSets it.sourceSets.main
// }
//}
//
//tasks.test {
// finalizedBy(tasks.codeCoverageReport) // report is always generated after tests run
//}
//check.dependsOn codeCoverageReport