feat(studio): integrate project MCP setup and lifecycle
This commit is contained in:
@@ -4,6 +4,7 @@ plugins {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(libs.tomlj)
|
||||
implementation(project(":prometeu-infra"))
|
||||
implementation(project(":prometeu-lsp:prometeu-lsp-api"))
|
||||
implementation(project(":prometeu-lsp:prometeu-lsp-v1"))
|
||||
@@ -26,6 +27,36 @@ 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")
|
||||
@@ -77,3 +108,20 @@ tasks.register<Test>("headlessMcpDesktopTest") {
|
||||
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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user