71 lines
2.2 KiB
Kotlin
71 lines
2.2 KiB
Kotlin
plugins {
|
|
`java-library`
|
|
}
|
|
|
|
dependencies {
|
|
api(project(":engine"))
|
|
implementation(project(":content-pokemon"))
|
|
|
|
compileOnly("com.hypixel.hytale:Server:0.5.9")
|
|
implementation("com.fasterxml.jackson.core:jackson-databind:2.20.0")
|
|
|
|
testImplementation(platform("org.junit:junit-bom:6.0.0"))
|
|
testImplementation("org.junit.jupiter:junit-jupiter")
|
|
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
|
|
testImplementation("org.assertj:assertj-core:3.27.6")
|
|
}
|
|
|
|
tasks.jar {
|
|
enabled = false
|
|
}
|
|
|
|
val fanModJar = tasks.register<Jar>("fanModJar") {
|
|
group = "build"
|
|
description = "Packages the unofficial non-commercial fan plugin and embedded asset pack."
|
|
dependsOn(configurations.runtimeClasspath)
|
|
archiveBaseName.set("ProjectCapture")
|
|
archiveClassifier.set("fan-dev")
|
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
|
|
|
from(sourceSets.main.get().output)
|
|
// Keep generated Blockbench exports at their content-declared paths so an
|
|
// embedded Hytale asset pack can resolve `assets/fan/...` references.
|
|
from(rootProject.layout.projectDirectory.dir("assets")) {
|
|
into("assets")
|
|
}
|
|
from({
|
|
configurations.runtimeClasspath.get()
|
|
.filter { it.exists() }
|
|
.map { if (it.isDirectory) it else zipTree(it) }
|
|
})
|
|
|
|
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA")
|
|
manifest {
|
|
attributes["Implementation-Title"] = "ProjectCapture Unofficial Fan Project"
|
|
attributes["Implementation-Version"] = project.version
|
|
attributes["ProjectCapture-Distribution"] = "UNOFFICIAL-NONCOMMERCIAL"
|
|
}
|
|
}
|
|
|
|
tasks.assemble {
|
|
dependsOn(fanModJar)
|
|
}
|
|
|
|
tasks.register<Copy>("installToDevMods") {
|
|
group = "development"
|
|
description = "Copies the fan mod only into an explicitly configured isolated dev Mods directory."
|
|
dependsOn(fanModJar)
|
|
|
|
val configuredModsDir = providers.gradleProperty("projectCapture.devModsDir")
|
|
onlyIf {
|
|
if (!configuredModsDir.isPresent) {
|
|
logger.lifecycle("Skipping install: set -PprojectCapture.devModsDir=<isolated Mods directory>.")
|
|
false
|
|
} else {
|
|
true
|
|
}
|
|
}
|
|
from(fanModJar.flatMap { it.archiveFile })
|
|
into(configuredModsDir)
|
|
}
|