Start project-owned language and authenticated MCP services when opening a project, reusing the embedded LSP backend without a desktop TCP listener. Keep editor overlays separate from saved-file MCP queries. Reserve conflicting editing before ACP prompt delivery and retain protection through native/tool termination, runtime cleanup and document refresh. Preserve drafts on rejected admission, provide cleanup/preparation recovery, distinguish terminal outcomes and redact permission previews. Add lifecycle, language parity, activity, composition and UI regressions and update the canonical Studio contracts. Keep distribution update alignment as the separate WRK-002A follow-up. Validation: complete make -C tooling verify PASSED in 20261127T035822Z-ec5d9266 (1172 unit, 131 compiler fixture, 31 headless tests). Opt-in real-model and native AI-view qualification are outside that gate. Work: WRK-0029; decision: DEC-0001.
302 lines
15 KiB
Kotlin
302 lines
15 KiB
Kotlin
plugins {
|
|
id("gradle.java-application-conventions")
|
|
alias(libs.plugins.javafx)
|
|
}
|
|
|
|
// Configure the application-capable UI module before lazy classpath queries configure it.
|
|
evaluationDependsOn(":prometeu-studio-ui-javafx-2")
|
|
|
|
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(project(":prometeu-studio-ui-javafx-2"))
|
|
implementation(libs.spring.boot)
|
|
implementation(libs.lsp4j)
|
|
implementation(libs.javafx.controls)
|
|
implementation(libs.javafx.fxml)
|
|
}
|
|
|
|
application {
|
|
mainClass = "p.studio.app.StudioLauncher"
|
|
applicationDefaultJvmArgs = listOf("--enable-native-access=ALL-UNNAMED")
|
|
}
|
|
|
|
val studioJava = javaToolchains.launcherFor { languageVersion = JavaLanguageVersion.of(25) }
|
|
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"), "--module-path", jdk.resolve("jmods"), "--add-modules", "ALL-MODULE-PATH", "--strip-debug", "--no-header-files",
|
|
"--no-man-pages", "--output", studioRuntime.get().asFile)
|
|
}
|
|
distributions {
|
|
main { contents {
|
|
from(assembleStudioRuntime) { into("runtime") }
|
|
from(project(":prometeu-studio-ui-javafx-2").file("src/main/resources/p/studio/ui/javafx2/fonts")) {
|
|
include("*-LICENSE.txt");into("licenses")
|
|
}
|
|
} }
|
|
}
|
|
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("**/GuestTestsInstalledRuntimeTest.class", "**/AssetAuthoringDesktopTest.class", "**/AnimationDesktopTest.class", "**/AnimationInstalledRuntimeTest.class", "**/DevDesktopTest.class", "**/InstalledKnowledgeTest.class", "**/HeadlessInstalledRuntimeTest.class", "**/HeadlessTaskIntegrationTest.class", "**/HeadlessMcpDesktopTest.class", "**/MemcardInstalledRuntimeTest.class") }
|
|
tasks.register<Test>("assetAuthoringDesktopTest") {
|
|
group = "verification"
|
|
description = "Inspects and qualifies the actual Assets authoring workspace (requires a display)."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/AssetAuthoringDesktopTest.class")
|
|
systemProperty("java.awt.headless", "false")
|
|
}
|
|
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("**/GuestTestsInstalledRuntimeTest.class")
|
|
include("**/AnimationInstalledRuntimeTest.class")
|
|
include("**/BeaconWorkshopInstalledRuntimeTest.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(""))
|
|
systemProperty("studio.test.pong", rootProject.file("test-projects/pong").absolutePath)
|
|
}
|
|
|
|
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)
|
|
systemProperty("studio.test.studioHost", providers.gradleProperty("studioPlayHost").getOrElse(
|
|
rootProject.file("../runtime/target/debug/prometeu-host-desktop-winit" + if (System.getProperty("os.name").startsWith("Windows")) ".exe" else "").absolutePath))
|
|
systemProperty("studio.test.studioCartridge", rootProject.file("../runtime/test-cartridges/dummy-boy").absolutePath)
|
|
}
|
|
|
|
tasks.named<Test>("test") { exclude("**/StudioPlayProcessTest.class") }
|
|
tasks.named<Test>("test") { exclude("**/StudioPlayDesktopTest.class") }
|
|
tasks.named<Test>("test") { exclude("**/StudioProjectsDesktopTest.class") }
|
|
tasks.named<Test>("test") { exclude("**/CodexAcpSmokeTest.class") }
|
|
tasks.register<Test>("codexAcpSmoke") {
|
|
group = "verification"
|
|
description = "Sends one minimal ACP prompt using an existing ChatGPT login in a disposable project."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/CodexAcpSmokeTest.class")
|
|
systemProperty("studio.test.codexAcp", providers.gradleProperty("studioCodexAcp").getOrElse(""))
|
|
systemProperty("studio.test.codexProject", providers.gradleProperty("studioCodexProject").getOrElse(""))
|
|
outputs.upToDateWhen { false }
|
|
testLogging.showStandardStreams = true
|
|
}
|
|
tasks.register<Test>("studioProjectsDesktopTest") {
|
|
group = "verification"
|
|
description = "Qualifies launcher, new-project wizard, loading shield and window lifecycle on a desktop."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/StudioProjectsDesktopTest.class")
|
|
systemProperty("java.awt.headless", "false")
|
|
systemProperty("studio.test.projectsCaptures", layout.buildDirectory.dir("projects-desktop-captures").get().asFile.absolutePath)
|
|
outputs.upToDateWhen { false }
|
|
testLogging.showStandardStreams = true
|
|
}
|
|
tasks.register<Test>("studioPlayDesktopTest") {
|
|
group = "verification"
|
|
description = "Qualifies the default Play frontend with an installed native runtime and a desktop."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/StudioPlayDesktopTest.class")
|
|
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
|
|
systemProperty("studio.test.pong", rootProject.file("test-projects/pong").absolutePath)
|
|
systemProperty("studio.test.playStress", providers.gradleProperty("studioPlayStress").getOrElse("false"))
|
|
systemProperty("java.awt.headless", "false")
|
|
outputs.upToDateWhen { false }
|
|
testLogging.showStandardStreams = true
|
|
}
|
|
tasks.register<Test>("studioPlayProcessTest") {
|
|
group = "verification"
|
|
description = "Qualifies real interactive binary IPC (requires the Studio host binary, no display)."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/StudioPlayProcessTest.class")
|
|
include("**/StudioPlayInstalledRuntimeTest.class")
|
|
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
|
|
outputs.upToDateWhen { false }
|
|
}
|
|
tasks.named<Test>("test") { exclude("**/StudioPlayInstalledRuntimeTest.class") }
|
|
|
|
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)
|
|
}
|
|
|
|
tasks.named<Test>("test") { exclude("**/GuestTestPilotTest.class") }
|
|
tasks.register<Test>("guestTestPilotTest") {
|
|
group = "verification"
|
|
description = "Runs isolated public shop/save tests on a disposable copy of the selected actual game."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/GuestTestPilotTest.class")
|
|
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
|
|
systemProperty("studio.test.guestPilotProject", providers.gradleProperty("studioGuestPilotProject").getOrElse(""))
|
|
}
|
|
|
|
tasks.named<Test>("test") { exclude("**/GuestTestsDesktopTest.class") }
|
|
tasks.register<Test>("guestTestsDesktopTest") {
|
|
group = "verification"
|
|
description = "Qualifies the actual Tests workspace and authenticated MCP against the installed provider."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/GuestTestsDesktopTest.class")
|
|
systemProperty("java.awt.headless", "false")
|
|
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
|
|
}
|
|
|
|
tasks.named<Test>("test") { exclude("**/AssetCapacityInstalledRuntimeTest.class", "**/AssetManagedBuildInstalledRuntimeTest.class") }
|
|
tasks.register<Test>("assetCapacityProcessTest") {
|
|
group = "verification"
|
|
description = "Qualifies glyph/scene 16/17 boundaries against the exact installed runtime."
|
|
// The selected installation is external and can be rebuilt at the same path.
|
|
outputs.upToDateWhen { false }
|
|
outputs.doNotCacheIf("Qualification must observe the currently installed native binaries") { true }
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/AssetCapacityInstalledRuntimeTest.class")
|
|
include("**/AssetManagedBuildInstalledRuntimeTest.class")
|
|
systemProperty("studio.test.runtimeInstall", providers.gradleProperty("studioRuntimeInstall").getOrElse(""))
|
|
}
|
|
|
|
tasks.register<Test>("studioControlsDesktopTest") {
|
|
group = "verification"
|
|
description = "Checks native mouse rendering and the Studio shell in isolated JavaFX windows."
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/StudioControlsDesktopTest.class")
|
|
systemProperty("java.awt.headless", "false")
|
|
systemProperty("studio.test.controlsCaptures", layout.buildDirectory.dir("controls-desktop-captures").get().asFile.absolutePath)
|
|
outputs.upToDateWhen { false }
|
|
testLogging.showStandardStreams = true
|
|
}
|
|
|
|
|
|
// Explicit full-path real-model qualification; excluded from ordinary unit tests by integration tag.
|
|
tasks.register<Test>("integratedAiLiveTest") {
|
|
group = "verification"
|
|
description = "Qualifies integrated ACP discovery, project MCP references and internal language with an existing login."
|
|
dependsOn(tasks.named("installDist"))
|
|
testClassesDirs = sourceSets["test"].output.classesDirs
|
|
classpath = sourceSets["test"].runtimeClasspath
|
|
useJUnitPlatform()
|
|
include("**/IntegratedAiLiveTest.class")
|
|
systemProperty("studio.test.distribution", layout.buildDirectory.dir("install/prometeu-app").get().asFile.absolutePath)
|
|
systemProperty("studio.test.codexAcp", providers.gradleProperty("studioCodexAcp").getOrElse(""))
|
|
outputs.upToDateWhen { false }
|
|
}
|