build: 优化构建脚本

This commit is contained in:
2024-08-09 01:23:54 +08:00
parent fe2e658c50
commit 3dab447178
2 changed files with 9 additions and 11 deletions

View File

@@ -24,27 +24,26 @@ dependencies {
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
}
tasks {
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
}
tasks {
processResources {
filesMatching("plugin.yml") {
expand(project.properties)
}
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
jar {
destinationDirectory = rootProject.layout.buildDirectory
}
withType<JavaCompile>().configureEach {
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<Jar>().configureEach {
withType<Jar> {
archiveBaseName = "HamsterScript"
from(rootProject.file("LICENSE"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
destinationDirectory = rootProject.layout.buildDirectory
}
}

View File

@@ -1,2 +1 @@
rootProject.name = "hamster-script"