feat(ball-velocity): 添加 velocity 支持
This commit is contained in:
41
ball-velocity/build.gradle.kts
Normal file
41
ball-velocity/build.gradle.kts
Normal file
@@ -0,0 +1,41 @@
|
||||
@file:Suppress("VulnerableLibrariesLocal")
|
||||
|
||||
evaluationDependsOn(":ball-common")
|
||||
|
||||
dependencies {
|
||||
api(project(":ball-common")) { isTransitive = false }
|
||||
compileOnly("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
|
||||
annotationProcessor("com.velocitypowered:velocity-api:3.3.0-SNAPSHOT")
|
||||
compileOnly("cn.hamster3.mc.plugin:core-common:+")
|
||||
}
|
||||
|
||||
sourceSets.create("templates") {
|
||||
java {
|
||||
srcDir("src/main/templates")
|
||||
}
|
||||
}
|
||||
|
||||
val templateSource = file("src/main/templates")
|
||||
val templateDest = layout.buildDirectory.dir("generated/sources/templates")
|
||||
val generateTemplates = tasks.register<Copy>("generateTemplates") {
|
||||
from(templateSource)
|
||||
into(templateDest)
|
||||
expand(project.properties)
|
||||
}
|
||||
|
||||
sourceSets.main.get().java.srcDir(generateTemplates.map { it.outputs })
|
||||
|
||||
java {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
withSourcesJar()
|
||||
}
|
||||
|
||||
tasks {
|
||||
withType<Jar> {
|
||||
archiveBaseName = "HamsterBall-Velocity"
|
||||
}
|
||||
shadowJar {
|
||||
destinationDirectory = rootProject.layout.buildDirectory
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user