Skip to content

Commit 6a6c5c0

Browse files
committed
Added LSP Develop gradle task
1 parent ecd219b commit 6a6c5c0

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

app/build.gradle.kts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,27 @@ tasks.compileJava{
133133
options.encoding = "UTF-8"
134134
}
135135

136+
tasks.register("lsp-develop"){
137+
group = "processing"
138+
// This task is used to run the LSP server when developing the LSP server itself
139+
// to run the LSP server for end-users use `processing lsp` instead
140+
dependencies.add("runtimeOnly", project(":java"))
141+
142+
// Usage: ./gradlew lsp-develop
143+
// Make sure the cwd is set the project directory
144+
// or use -p to set the project directory
145+
146+
// Modify run configuration to start the LSP server rather than the Processing IDE
147+
val run = tasks.named<JavaExec>("run").get()
148+
run.standardInput = System.`in`
149+
run.standardOutput = System.out
150+
dependsOn(run)
151+
152+
// TODO: Remove after command line is integrated, then add the `lsp` argument instead, `lsp-develop` can't be removed because we still need to pipe the input and output
153+
run.jvmArgs("-Djava.awt.headless=true")
154+
compose.desktop.application.mainClass = "processing.mode.java.lsp.PdeLanguageServer"
155+
}
156+
136157
val version = if(project.version == "unspecified") "1.0.0" else project.version
137158

138159
tasks.register<Exec>("installCreateDmg") {

0 commit comments

Comments
 (0)