build: 优化构建脚本
This commit is contained in:
32
build.gradle
32
build.gradle
@@ -2,7 +2,7 @@ plugins {
|
|||||||
id 'java'
|
id 'java'
|
||||||
}
|
}
|
||||||
|
|
||||||
group 'cn.hamster3.mc.plugin'
|
group 'cn.hamster3.mc.plugin.core'
|
||||||
version '1.0.0-SNAPSHOT'
|
version '1.0.0-SNAPSHOT'
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
@@ -29,8 +29,16 @@ subprojects {
|
|||||||
compileOnly 'org.jetbrains:annotations:23.0.0'
|
compileOnly 'org.jetbrains:annotations:23.0.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
|
withJavadocJar()
|
||||||
|
withSourcesJar()
|
||||||
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.setEncoding("UTF-8")
|
options.encoding = 'UTF-8'
|
||||||
|
options.compilerArgs << "-Xlint:unchecked"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(Jar) {
|
tasks.withType(Jar) {
|
||||||
@@ -38,17 +46,25 @@ subprojects {
|
|||||||
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
duplicatesStrategy(DuplicatesStrategy.EXCLUDE)
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
javadoc {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
options.quiet()
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
options.encoding = 'utf8'
|
||||||
// withJavadocJar()
|
options.jFlags("-Dfile.encoding=utf8")
|
||||||
withSourcesJar()
|
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 {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
from project.components.java
|
artifactId = project.name.split('-')[2]
|
||||||
|
artifact jar
|
||||||
|
artifact sourcesJar
|
||||||
|
artifact javadocJar
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
Reference in New Issue
Block a user