Skip to content

Commit

Permalink
Add setup for Gradle debugging in VS Codium
Browse files Browse the repository at this point in the history
  • Loading branch information
p3k committed Jun 15, 2024
1 parent 6401300 commit 7219f91
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 83 deletions.
128 changes: 45 additions & 83 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,84 +1,46 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "ImageInfo",
"request": "launch",
"mainClass": "helma.image.ImageInfo",
"projectName": "helma_"
},
{
"type": "java",
"name": "CommandlineRunner",
"request": "launch",
"mainClass": "helma.main.CommandlineRunner",
"projectName": "helma_"
},
{
"type": "java",
"name": "Server",
"request": "launch",
"mainClass": "helma.main.Server",
"projectName": "helma_"
},
{
"type": "java",
"name": "XmlConverter",
"request": "launch",
"mainClass": "helma.objectmodel.dom.XmlConverter",
"projectName": "helma_"
},
{
"type": "java",
"name": "Crypt",
"request": "launch",
"mainClass": "helma.util.Crypt",
"projectName": "helma_"
},
{
"type": "java",
"name": "HtmlEncoder",
"request": "launch",
"mainClass": "helma.util.HtmlEncoder",
"projectName": "helma_"
},
{
"type": "java",
"name": "Logo",
"request": "launch",
"mainClass": "helma.util.Logo",
"projectName": "helma_"
},
{
"type": "java",
"name": "MarkdownProcessor",
"request": "launch",
"mainClass": "helma.util.MarkdownProcessor",
"projectName": "helma_"
},
{
"type": "java",
"name": "Commandline",
"request": "launch",
"mainClass": "helma.main.launcher.Commandline",
"projectName": "launcher"
},
{
"type": "java",
"name": "Main",
"request": "launch",
"mainClass": "helma.main.launcher.Main",
"projectName": "launcher"
}
]
}
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Current File",
"request": "launch",
"mainClass": "${file}"
},
{
"type": "java",
"name": "Run with Gradle",
"request": "launch",
"mainClass": "helma.main.Server",
"projectName": "helma",
"preLaunchTask": "Run with Gradle",
"console": "integratedTerminal",
"stopOnEntry": false
},
{
"name": "Debug with Gradle",
"type": "java",
"request": "attach",
"hostName": "localhost",
"port": 5005,
"preLaunchTask": "Debug with Gradle",
},
{
"type": "java",
"name": "Commandline",
"request": "launch",
"mainClass": "helma.main.launcher.Commandline",
"projectName": "launcher"
},
{
"type": "java",
"name": "Main",
"request": "launch",
"mainClass": "helma.main.launcher.Main",
"projectName": "launcher"
}
]
}
32 changes: 32 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Run with Gradle",
"type": "shell",
"command": "./gradlew",
"args": [
"run"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "Debug with Gradle",
"type": "shell",
"command": "./gradlew",
"args": [
"debug"
],
"group": {
"kind": "build"
},
"problemMatcher": []
}
]
}
8 changes: 8 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,11 @@ task commandLine(type: JavaExec) {
mainClass = 'helma.main.launcher.Commandline'
args '-h', projectDir, function
}

tasks.register('debug', JavaExec) {
group = 'application'
main = 'helma.main.Server'
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ['-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005']
classpath += fileTree(dir: 'lib/ext', include: '*.jar')
}

0 comments on commit 7219f91

Please sign in to comment.