Files
prometeu-studio/prometeu-app/build.gradle.kts
T
bquarkz bf31184d4d feat(pbs): add sprite animation and shared Studio authoring
Implement DEC-0084 with factory-only Sprite/Animator structs, complete result
lowering, validated animation sidecars, generated PBS factories and JavaFX/MCP
authoring through shared services.

Qualify native dev/release with ordinary and optimized producers, zero-allocation
playback, private-cycle reclamation, canonical Composer pixels, installed JARs
and JavaFX lifecycle. Preserve the runtime checkout and existing host ABI.
2026-11-05 15:16:07 +00:00

155 lines
7.4 KiB
Kotlin

plugins {
id("gradle.java-application-conventions")
alias(libs.plugins.javafx)
}
dependencies {
implementation(libs.tomlj)
implementation(project(":prometeu-infra"))
implementation(project(":prometeu-lsp:prometeu-lsp-api"))
implementation(project(":prometeu-lsp:prometeu-lsp-v1"))
implementation(project(":prometeu-compiler:prometeu-compiler-core"))
implementation(project(":prometeu-compiler:prometeu-build-pipeline"))
implementation(project(":prometeu-compiler:prometeu-frontend-registry"))
implementation(project(":prometeu-compiler:prometeu-deps"))
implementation(project(":prometeu-packer:prometeu-packer-api"))
implementation(project(":prometeu-packer:prometeu-packer-v1"))
implementation(project(":prometeu-studio-api"))
implementation(project(":prometeu-studio-core"))
implementation(project(":prometeu-studio-ui-javafx"))
implementation(libs.spring.boot)
implementation(libs.lsp4j)
implementation(libs.javafx.controls)
implementation(libs.javafx.fxml)
}
application {
mainClass = "p.studio.app.StudioLauncher"
}
val studioJava = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(21) }
val studioRuntime = layout.buildDirectory.dir("studio-runtime")
val assembleStudioRuntime by tasks.registering(Exec::class) {
val jdk = studioJava.get().metadata.installationPath.asFile
inputs.property("jdk", jdk.absolutePath)
outputs.dir(studioRuntime)
doFirst { delete(studioRuntime) }
// jlink license files can be read-only; Gradle Sync must be able to refresh the installed image.
doLast {
studioRuntime.get().asFile.walkTopDown().filter { it.isFile }.forEach {
check(it.setWritable(true, true)) { "Cannot normalize staged runtime permissions" }
}
}
commandLine(jdk.resolve("bin/jlink"), "--add-modules", "ALL-MODULE-PATH", "--strip-debug", "--no-header-files",
"--no-man-pages", "--output", studioRuntime.get().asFile)
}
distributions {
main { contents { from(assembleStudioRuntime) { into("runtime") } } }
}
tasks.register<JavaExec>("stageStudioInstallation") {
group = "application"
description = "Stages and validates the bundled Studio/Java installation; no project launcher is created."
dependsOn(tasks.named("installDist"))
classpath = sourceSets["main"].runtimeClasspath
mainClass = "p.studio.app.install.ManagedStudioInstallation"
args(layout.buildDirectory.dir("install/prometeu-app").get().asFile.absolutePath,
providers.gradleProperty("studioInstallationRoot").getOrElse(
"${System.getProperty("user.home")}/Library/Application Support/Prometeu/Studio"))
}
javafx {
version = libs.versions.javafx.get()
modules("javafx.controls", "javafx.fxml")
}
// Opt-in desktop gate: real JavaFX toolkit and windows, no display required by normal unit tests.
tasks.named<Test>("test") { exclude("**/AnimationDesktopTest.class", "**/AnimationInstalledRuntimeTest.class", "**/DevDesktopTest.class", "**/InstalledKnowledgeTest.class", "**/HeadlessInstalledRuntimeTest.class", "**/HeadlessTaskIntegrationTest.class", "**/HeadlessMcpDesktopTest.class", "**/MemcardInstalledRuntimeTest.class") }
tasks.register<Test>("devDesktopTest") {
group = "verification"
description = "Runs the DEV/Debug desktop lifecycle and handoff smoke tests (requires a display)."
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/DevDesktopTest.class")
systemProperty("java.awt.headless", "false")
}
tasks.register<Test>("animationDesktopTest") {
group = "verification"
description = "Authors and repairs an animation through the actual JavaFX editor (requires a display)."
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/AnimationDesktopTest.class")
systemProperty("java.awt.headless", "false")
}
tasks.register<Test>("installedKnowledgeTest") {
group = "verification"
description = "Reads installed references and compiles their example in an isolated JVM outside the checkout."
dependsOn(tasks.named("installDist"))
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/InstalledKnowledgeTest.class")
val distribution = layout.buildDirectory.dir("install/prometeu-app")
inputs.dir(distribution)
systemProperty("studio.test.distribution", distribution.get().asFile.absolutePath)
systemProperty("pbs.registryConformanceDirectory",
project(":prometeu-compiler:prometeu-build-pipeline").layout.buildDirectory.dir("registry-conformance").get().asFile.absolutePath)
}
tasks.register<Test>("headlessProcessTest") {
group = "verification"
description = "Exercises the configured packaged headless runtime (requires -PstudioRuntimeInstall)."
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/HeadlessInstalledRuntimeTest.class")
include("**/AnimationInstalledRuntimeTest.class")
systemProperty("pbs.registryConformanceDirectory",
project(":prometeu-compiler:prometeu-build-pipeline").layout.buildDirectory.dir("registry-conformance").get().asFile.absolutePath)
include("**/HeadlessTaskIntegrationTest.class")
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
}
tasks.register<Test>("memcardProcessTest") {
group = "verification"
description = "Qualifies PBS memcard save/reopen/version upgrade through the configured runtime installation."
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/MemcardInstalledRuntimeTest.class")
outputs.upToDateWhen { false }
testLogging.showStandardStreams = true
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
}
tasks.register<Test>("headlessMcpDesktopTest") {
group = "verification"
description = "Proves MCP/runtime/DEV parity and adversarial lifecycle (requires POSIX desktop, free Debug port 7777 and -PstudioRuntimeInstall)."
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/HeadlessMcpDesktopTest.class")
systemProperty("java.awt.headless", "false")
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
}
// Subprocess tests exercise the actual Studio main and OS ownership boundaries.
tasks.withType<Test>().configureEach {
systemProperty("studio.test.classpath", sourceSets["test"].runtimeClasspath.asPath)
}
tasks.named<Test>("test") { exclude("**/InstalledConnectorTest.class") }
tasks.register<Test>("installedConnectorTest") {
group = "verification"
description = "Validates installed Java, stable updates, project preparation and JavaFX startup (requires a display)."
dependsOn(tasks.named("installDist"))
testClassesDirs = sourceSets["test"].output.classesDirs
classpath = sourceSets["test"].runtimeClasspath
useJUnitPlatform()
include("**/InstalledConnectorTest.class")
systemProperty("studio.test.distribution", layout.buildDirectory.dir("install/prometeu-app").get().asFile.absolutePath)
}