-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
162 lines (135 loc) · 3.68 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
import org.springframework.boot.gradle.plugin.SpringBootPlugin
plugins {
alias(libs.plugins.jmh)
alias(libs.plugins.spring.boot) apply false
alias(libs.plugins.quarkus) apply false
alias(libs.plugins.apt)
alias(libs.plugins.spotless)
alias(libs.plugins.spotbugs)
alias(libs.plugins.gradle.versions.plugin)
alias(libs.plugins.version.catalog.update)
id 'pmd'
id 'jacoco'
id 'maven-publish'
id 'java'
}
description = 'Java Playground'
project.ext {
springProjects = subprojects.findAll {
it.name.startsWith('spring')
}
quarkusProjects = subprojects.findAll {
it.name.startsWith('quarkus')
}
}
configure(project.springProjects) {
apply plugin: 'io.spring.dependency-management'
dependencyManagement {
imports {
mavenBom SpringBootPlugin.BOM_COORDINATES
}
}
}
configure(project.quarkusProjects) {
apply plugin: 'io.quarkus'
dependencies {
implementation enforcedPlatform(libs.quarkusBom)
}
}
configure(allprojects) {
apply plugin: 'java-library'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'com.github.spotbugs'
apply plugin: 'pmd'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
group = 'dev.huka'
java {
withJavadocJar()
withSourcesJar()
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
test {
useJUnitPlatform()
finalizedBy jacocoTestReport
}
dependencies {
implementation "com.github.hukacode:huka-common:main-SNAPSHOT"
compileOnly libs.lombok
annotationProcessor libs.lombok
testCompileOnly libs.lombok
testAnnotationProcessor libs.lombok
implementation libs.mapstruct
implementation libs.mapstructJdk8
annotationProcessor libs.mapstructProcessor
testImplementation libs.junitJupiter
testImplementation libs.assertjCore
}
jacoco {
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled false
csv.enabled false
html.destination file('build/jacocoHtml')
}
}
pmd {
ignoreFailures = true
consoleOutput = true
rulesMinimumPriority = 5
}
spotless {
// ratchetFrom 'origin/main'
format 'misc', {
target '*.gradle', '*.md', '.gitignore'
trimTrailingWhitespace()
indentWithSpaces(2)
endWithNewline()
}
java {
toggleOffOn('formatter:off', 'formatter:on')
target 'src/*/java/**/*.java'
// importOrder('java', 'javax', 'org', 'com')
removeUnusedImports()
googleJavaFormat()
licenseHeaderFile rootProject.file('config/spotless.license')
}
}
compileJava.dependsOn spotlessApply
spotbugs {
ignoreFailures = true
showStackTraces = true
showProgress = true
effort = 'default'
reportLevel = 'default'
}
dependencies {
spotbugsPlugins libs.findsecbugs
}
tasks.matching { task -> task.name.startsWith('spotbugs') }.forEach {
it.reports {
html {
enabled = true
destination = file('build/spotbugs/main/spotbugs.html')
stylesheet = 'fancy-hist.xsl'
}
xml.enabled = false
}
}
repositories {
mavenLocal()
mavenCentral()
maven { url "https://jitpack.io" }
}
compileJava {
options.encoding = 'UTF-8'
options.compilerArgs << '-parameters'
}
compileTestJava {
options.encoding = 'UTF-8'
}
}