From ab2a0a90cd05abced6c73eb450104cdb7a45f93f Mon Sep 17 00:00:00 2001 From: MiniDay <372403923@qq.com> Date: Sat, 29 Oct 2022 04:08:29 +0800 Subject: [PATCH] =?UTF-8?q?build:=20=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 600bd56..c339359 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java' } -group 'cn.hamster3.mc.plugin' +group 'cn.hamster3.mc.plugin.core' version '1.0.0-SNAPSHOT' subprojects { @@ -29,8 +29,16 @@ subprojects { compileOnly 'org.jetbrains:annotations:23.0.0' } + java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + withJavadocJar() + withSourcesJar() + } + tasks.withType(JavaCompile) { - options.setEncoding("UTF-8") + options.encoding = 'UTF-8' + options.compilerArgs << "-Xlint:unchecked" } tasks.withType(Jar) { @@ -38,17 +46,25 @@ subprojects { duplicatesStrategy(DuplicatesStrategy.EXCLUDE) } - java { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -// withJavadocJar() - withSourcesJar() + javadoc { + options.quiet() + options.encoding = 'utf8' + options.jFlags("-Dfile.encoding=utf8") + options.links = [ + "https://javadoc.io/doc/org.jetbrains/annotations/23.0.0", + 'https://javadoc.io/doc/com.google.code.gson/gson/2.8.0', + 'http://milkbowl.github.io/VaultAPI', + 'https://bukkit.windit.net/javadoc' + ] } publishing { publications { mavenJava(MavenPublication) { - from project.components.java + artifactId = project.name.split('-')[2] + artifact jar + artifact sourcesJar + artifact javadocJar } } repositories {