build: 优化依赖

This commit is contained in:
2023-10-12 15:02:48 +08:00
parent bc79b1ed48
commit 19bac34bfb
5 changed files with 20 additions and 53 deletions

View File

@@ -9,7 +9,7 @@ version = "1.1.0-SNAPSHOT"
subprojects {
apply {
plugin("java")
plugin("java-library")
plugin("maven-publish")
plugin("com.github.johnrengelman.shadow")
}
@@ -24,40 +24,25 @@ subprojects {
}
dependencies {
// https://mvnrepository.com/artifact/org.jetbrains/annotations
implementation("org.jetbrains:annotations:24.0.1")
// https://mvnrepository.com/artifact/org.projectlombok/lombok
compileOnly("org.projectlombok:lombok:1.18.28")
annotationProcessor("org.projectlombok:lombok:1.18.28")
implementation("org.jetbrains:annotations:+")
compileOnly("org.projectlombok:lombok:+")
annotationProcessor("org.projectlombok:lombok:+")
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
// withJavadocJar()
withSourcesJar()
}
tasks {
withType<JavaCompile>().configureEach {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<Jar>().configureEach {
withType<Jar> {
from(rootProject.file("LICENSE"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
javadoc {
options.jFlags("-Dfile.encoding=utf8")
options.encoding = "UTF-8"
options.quiet()
val o: StandardJavadocDocletOptions = options as StandardJavadocDocletOptions
o.addStringOption("Xdoclint:none", "-quiet")
o.links(
"https://javadoc.io/doc/org.jetbrains/annotations/23.0.0",
"https://javadoc.io/doc/com.google.code.gson/gson/2.8.0",
"https://bukkit.windit.net/javadoc"
)
}
shadowJar {
relocate("org.yaml", "cn.hamster3.mc.plugin.ball.lib.org.yaml")
destinationDirectory = rootProject.buildDir