build: 优化构建脚本
This commit is contained in:
@@ -24,27 +24,26 @@ dependencies {
|
|||||||
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
|
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
java {
|
||||||
java {
|
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
withSourcesJar()
|
withSourcesJar()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks {
|
||||||
processResources {
|
processResources {
|
||||||
filesMatching("plugin.yml") {
|
filesMatching("plugin.yml") {
|
||||||
expand(project.properties)
|
expand(project.properties)
|
||||||
}
|
}
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
}
|
}
|
||||||
jar {
|
withType<JavaCompile> {
|
||||||
destinationDirectory = rootProject.layout.buildDirectory
|
|
||||||
}
|
|
||||||
withType<JavaCompile>().configureEach {
|
|
||||||
options.encoding = "UTF-8"
|
options.encoding = "UTF-8"
|
||||||
}
|
}
|
||||||
withType<Jar>().configureEach {
|
withType<Jar> {
|
||||||
archiveBaseName = "HamsterScript"
|
archiveBaseName = "HamsterScript"
|
||||||
from(rootProject.file("LICENSE"))
|
from(rootProject.file("LICENSE"))
|
||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
destinationDirectory = rootProject.layout.buildDirectory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,2 +1 @@
|
|||||||
rootProject.name = "hamster-script"
|
rootProject.name = "hamster-script"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user