-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbuild.gradle.kts
174 lines (147 loc) · 4.44 KB
/
build.gradle.kts
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
163
164
165
166
167
168
169
170
171
172
173
174
import com.diffplug.gradle.spotless.SpotlessPlugin
import net.kyori.indra.IndraPlugin
import net.kyori.indra.IndraPublishingPlugin
plugins {
java
`maven-publish`
`java-library`
id("de.chojo.publishdata") version "1.4.0"
alias(libs.plugins.spotless)
alias(libs.plugins.indra.core)
alias(libs.plugins.indra.publishing)
alias(libs.plugins.indra.sonatype)
}
publishData {
useEldoNexusRepos(false)
publishingVersion = "2.3.1"
}
group = "de.chojo.sadu"
version = publishData.getVersion()
description = "The SADU library, containing everything you need and not need."
dependencies {
api(project(":sadu-sqlite"))
api(project(":sadu-postgresql"))
api(project(":sadu-mariadb"))
api(project(":sadu-mysql"))
api(project(":sadu-updater"))
api(project(":sadu-datasource"))
}
subprojects {
apply {
// We want to apply several plugins to subprojects
plugin<JavaPlugin>()
plugin<SpotlessPlugin>()
plugin<de.chojo.PublishData>()
plugin<JavaLibraryPlugin>()
}
if (!project.name.contains("examples")) {
apply {
plugin<MavenPublishPlugin>()
plugin<IndraPlugin>()
plugin<IndraPublishingPlugin>()
plugin<SigningPlugin>()
}
indra {
javaVersions {
target(17)
testWith(17)
}
github("rainbowdashlabs", "sadu") {
ci(true)
}
lgpl3OrLaterLicense()
signWithKeyFromPrefixedProperties("rainbowdashlabs")
configurePublications {
pom {
developers {
developer {
id.set("rainbowdashlabs")
name.set("Florian Fülling")
email.set("[email protected]")
url.set("https://github.com/rainbowdashlabs")
}
}
}
}
}
}
}
indra {
javaVersions {
target(17)
testWith(17)
}
github("rainbowdashlabs", "sadu") {
ci(true)
}
lgpl3OrLaterLicense()
signWithKeyFromPrefixedProperties("rainbowdashlabs")
configurePublications {
pom {
developers {
developer {
id.set("rainbowdashlabs")
name.set("Florian Fülling")
email.set("[email protected]")
url.set("https://github.com/rainbowdashlabs")
}
}
}
}
}
indraSonatype {
useAlternateSonatypeOSSHost("s01")
}
allprojects {
repositories {
mavenCentral()
maven("https://eldonexus.de/repository/maven-public/")
maven("https://eldonexus.de/repository/maven-proxies/")
}
publishData {
useEldoNexusRepos(false)
}
dependencies {
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.11.3")
testRuntimeOnly("org.junit.jupiter", "junit-jupiter-engine", "5.11.3")
testImplementation("org.mockito", "mockito-core", "5.+")
}
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER.txt"))
target("**/*.java")
}
}
// We configure some general tasks for our modules
tasks {
test {
dependsOn(spotlessCheck)
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
compileJava {
dependsOn(spotlessApply)
}
javadoc {
applyJavaDocOptions(options)
}
}
}
fun applyJavaDocOptions(options: MinimalJavadocOptions) {
val javaDocOptions = options as StandardJavadocDocletOptions
javaDocOptions.links(
"https://javadoc.io/doc/org.jetbrains/annotations/latest/",
"https://docs.oracle.com/en/java/javase/${java.toolchain.languageVersion.get().asInt()}/docs/api/"
)
}
tasks {
register<Javadoc>("alljavadoc") {
applyJavaDocOptions(options)
setDestinationDir(file("${layout.buildDirectory.get()}/docs/javadoc"))
val projects = project.rootProject.allprojects.filter { p -> !p.name.contains("example") }
setSource(projects.map { p -> p.sourceSets.main.get().allJava.filter{ p -> p.name != "module-info.java"} })
classpath = files(projects.map { p -> p.sourceSets.main.get().compileClasspath })
}
}