fix: 修复构建脚本错误
This commit is contained in:
@@ -2,14 +2,13 @@
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
id("com.github.johnrengelman.shadow") version "8+"
|
||||
}
|
||||
|
||||
group = "cn.hamster3.mc.plugin"
|
||||
version = "1.0.3"
|
||||
description = "为Minecraft服务器导入 OpenJDK Nashorn 引擎来执行 JavaScript 脚本"
|
||||
|
||||
val shade = configurations.create("shade")
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
url = uri("https://maven.airgame.net/maven-public/")
|
||||
@@ -27,7 +26,6 @@ dependencies {
|
||||
|
||||
// https://mvnrepository.com/artifact/org.openjdk.nashorn/nashorn-core
|
||||
implementation("org.openjdk.nashorn:nashorn-core:15.4")
|
||||
shade("org.openjdk.nashorn:nashorn-core:15.4")
|
||||
}
|
||||
|
||||
tasks {
|
||||
@@ -42,24 +40,21 @@ tasks {
|
||||
}
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
val shadeJar = create<Jar>("shadeJar") {
|
||||
archiveBaseName = "HamsterScript"
|
||||
archiveClassifier = "all"
|
||||
destinationDirectory = rootProject.layout.buildDirectory
|
||||
from(shade.map { if (it.isDirectory) it else zipTree(it) })
|
||||
}
|
||||
jar {
|
||||
archiveBaseName = "HamsterScript"
|
||||
destinationDirectory = rootProject.layout.buildDirectory
|
||||
}
|
||||
shadowJar {
|
||||
destinationDirectory = rootProject.layout.buildDirectory
|
||||
}
|
||||
withType<JavaCompile>().configureEach {
|
||||
options.encoding = "UTF-8"
|
||||
}
|
||||
withType<Jar>().configureEach {
|
||||
archiveBaseName = "HamsterScript"
|
||||
from(rootProject.file("LICENSE"))
|
||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||
}
|
||||
build {
|
||||
dependsOn(shadeJar)
|
||||
dependsOn(shadowJar)
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user