Load the fixed protocol vectors from test resources instead of a sibling runtime checkout, preserving all wire assertions. Validation: the Jenkins Gradle command passed under JDK 25 in an isolated Studio checkout without ../runtime; 1064 tests, zero failures, consolidated JaCoCo report generated.
247 lines
13 KiB
Kotlin
247 lines
13 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")
|
|
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.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(""))
|
|
}
|