Skip to content

Commit 5ccb503

Browse files
authored
Merge pull request #1059 from Stefterv/lsp-develop
Added LSP Develop gradle task
2 parents 962443c + 1a2ba32 commit 5ccb503

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
@@ -136,6 +136,27 @@ tasks.compileJava{
136136
options.encoding = "UTF-8"
137137
}
138138

139+
tasks.register("lsp-develop"){
140+
group = "processing"
141+
// This task is used to run the LSP server when developing the LSP server itself
142+
// to run the LSP server for end-users use `processing lsp` instead
143+
dependencies.add("runtimeOnly", project(":java"))
144+
145+
// Usage: ./gradlew lsp-develop
146+
// Make sure the cwd is set to the project directory
147+
// or use -p to set the project directory
148+
149+
// Modify run configuration to start the LSP server rather than the Processing IDE
150+
val run = tasks.named<JavaExec>("run").get()
151+
run.standardInput = System.`in`
152+
run.standardOutput = System.out
153+
dependsOn(run)
154+
155+
// 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
156+
run.jvmArgs("-Djava.awt.headless=true")
157+
compose.desktop.application.mainClass = "processing.mode.java.lsp.PdeLanguageServer"
158+
}
159+
139160
val version = if(project.version == "unspecified") "1.0.0" else project.version
140161

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

0 commit comments

Comments
 (0)