From 1387c58fd4946956efb42c596cc7d7cd18c38bf0 Mon Sep 17 00:00:00 2001 From: MiniDay <372403923@qq.com> Date: Sat, 29 Oct 2022 04:17:27 +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 | 50 ++++++++++++++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/build.gradle b/build.gradle index 4e08378..071186c 100644 --- a/build.gradle +++ b/build.gradle @@ -2,8 +2,8 @@ plugins { id 'java' } -group 'cn.hamster3.mc.plugin' -version = '1.0.0-SNAPSHOT' +group 'cn.hamster3.mc.plugin.ball' +version '1.0.0-SNAPSHOT' subprojects { apply plugin: 'java-library' @@ -25,22 +25,10 @@ subprojects { } dependencies { - // https://mvnrepository.com/artifact/org.projectlombok/lombok - compileOnly 'org.projectlombok:lombok:1.18.24' - annotationProcessor 'org.projectlombok:lombok:1.18.24' // https://mvnrepository.com/artifact/org.jetbrains/annotations compileOnly 'org.jetbrains:annotations:23.0.0' } - tasks.withType(JavaCompile) { - options.setEncoding("UTF-8") - } - - tasks.withType(Jar) { - from([rootProject.file("LICENSE")]) - duplicatesStrategy(DuplicatesStrategy.EXCLUDE) - } - java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 @@ -48,10 +36,36 @@ subprojects { withSourcesJar() } + tasks.withType(JavaCompile) { + options.encoding = 'UTF-8' + } + + tasks.withType(Jar) { + from([rootProject.file("LICENSE")]) + duplicatesStrategy(DuplicatesStrategy.EXCLUDE) + } + + javadoc { + options.quiet() + options.encoding = 'UTF-8' + options.jFlags("-Dfile.encoding=utf8") + options.addStringOption('Xdoclint:none', '-quiet') + 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 getProject().getComponents().java + var projectNameSplit = project.name.split('-') + artifactId = projectNameSplit[projectNameSplit.length - 1] + artifact jar + artifact sourcesJar +// artifact javadocJar } } repositories { @@ -62,10 +76,10 @@ subprojects { url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl credentials { - username rootProject.getProperties().getOrDefault("maven_username", "") - password rootProject.getProperties().getOrDefault("maven_password", "") + username rootProject.properties.getOrDefault("maven_username", "") + password rootProject.properties.getOrDefault("maven_password", "") } } } } -} +} \ No newline at end of file