59 lines
1.6 KiB
Plaintext
59 lines
1.6 KiB
Plaintext
@file:Suppress("VulnerableLibrariesLocal")
|
|
|
|
plugins {
|
|
id("java")
|
|
}
|
|
|
|
group = "cn.hamster3.mc.plugin"
|
|
version = "1.0.1"
|
|
description = "为Minecraft服务器导入 OpenJDK Nashorn 引擎来执行 JavaScript 脚本"
|
|
|
|
val shade = configurations.create("shade")
|
|
|
|
repositories {
|
|
maven {
|
|
url = uri("https://maven.airgame.net/maven-public/")
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
// https://mvnrepository.com/artifact/org.jetbrains/annotations
|
|
compileOnly("org.jetbrains:annotations:24.1.0")
|
|
// https://mvnrepository.com/artifact/org.projectlombok/lombok
|
|
compileOnly("org.projectlombok:lombok:1.18.30")
|
|
annotationProcessor("org.projectlombok:lombok:1.18.30")
|
|
|
|
compileOnly("org.spigotmc:spigot-api:1.18.2-R0.1-SNAPSHOT")
|
|
|
|
// https://mvnrepository.com/artifact/org.openjdk.nashorn/nashorn-core
|
|
implementation("org.openjdk.nashorn:nashorn-core:15.0")
|
|
shade("org.openjdk.nashorn:nashorn-core:15.0")
|
|
}
|
|
|
|
tasks {
|
|
withType<JavaCompile>().configureEach {
|
|
options.encoding = "UTF-8"
|
|
}
|
|
withType<Jar>().configureEach {
|
|
from(rootProject.file("LICENSE"))
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
|
targetCompatibility = JavaVersion.VERSION_1_8
|
|
withSourcesJar()
|
|
}
|
|
jar {
|
|
archiveBaseName = "HamsterScript"
|
|
destinationDirectory = rootProject.layout.buildDirectory
|
|
|
|
from(shade.map { if (it.isDirectory) it else zipTree(it) })
|
|
}
|
|
processResources {
|
|
filesMatching("plugin.yml") {
|
|
expand(project.properties)
|
|
}
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
}
|
|
}
|