Add setup for Gradle debugging in VS Codium

This commit is contained in:
Tobi Schäfer 2024-06-15 14:59:33 +02:00
parent 79b7e8092b
commit 6b694a83ed
Signed by: tobi
GPG key ID: 91FAE6FE2EBAC4C8
3 changed files with 119 additions and 83 deletions

126
.vscode/launch.json vendored
View file

@ -1,84 +1,46 @@
{ {
// Use IntelliSense to learn about possible attributes. // Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes. // Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0", "version": "0.2.0",
"configurations": [ "configurations": [
{ {
"type": "java", "type": "java",
"name": "Current File", "name": "Current File",
"request": "launch", "request": "launch",
"mainClass": "${file}" "mainClass": "${file}"
}, },
{ {
"type": "java", "type": "java",
"name": "ImageInfo", "name": "Run with Gradle",
"request": "launch", "request": "launch",
"mainClass": "helma.image.ImageInfo", "mainClass": "helma.main.Server",
"projectName": "helma_" "projectName": "helma",
}, "preLaunchTask": "Run with Gradle",
{ "console": "internalConsole",
"type": "java", "stopOnEntry": false
"name": "CommandlineRunner", },
"request": "launch", {
"mainClass": "helma.main.CommandlineRunner", "name": "Debug with Gradle",
"projectName": "helma_" "type": "java",
}, "request": "attach",
{ "hostName": "localhost",
"type": "java", "port": 5005,
"name": "Server", "preLaunchTask": "Debug with Gradle"
"request": "launch", },
"mainClass": "helma.main.Server", {
"projectName": "helma_" "type": "java",
}, "name": "Commandline",
{ "request": "launch",
"type": "java", "mainClass": "helma.main.launcher.Commandline",
"name": "XmlConverter", "projectName": "launcher"
"request": "launch", },
"mainClass": "helma.objectmodel.dom.XmlConverter", {
"projectName": "helma_" "type": "java",
}, "name": "Main",
{ "request": "launch",
"type": "java", "mainClass": "helma.main.launcher.Main",
"name": "Crypt", "projectName": "launcher"
"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"
}
]
} }

66
.vscode/tasks.json vendored Normal file
View file

@ -0,0 +1,66 @@
{
// 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 run",
"isBackground": true,
"group": {
"isDefault": true
},
"problemMatcher": {
"owner": "java",
"fileLocation": "absolute",
"pattern": [
{
// [2024/06/15 16:23:22] [ERROR] [antville-1] GET:main.css helma.scripting.ScriptingException: TypeError: Cannot find function getStaticFile in object HopObject Skin. (/home/tobi/Projects/helma/repo/./apps/antville/code/Site/Site.js#474)
"regexp": "^\\[.+\\] \\[(.+)\\] \\[.+\\] \\S+ \\s+: (.+) \\(([^#]+)#(\\d+)\\)$",
"severity": 1,
"message": 2,
"file": 3,
"line": 4
},
{
// [2024/06/15 17:26:00] [INFO] [antville-1] INTERNAL:onStart done in 381 millis
"regexp": "^.+INTERNAL:onStart done in \\d+ millis",
"kind": "file",
"file": 0
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "^.+(INTERNAL):onStart done in \\d+ millis",
"endsPattern": "terminated with exit code"
}
}
},
{
"label": "Debug with Gradle",
"type": "shell",
"command": "./gradlew debug",
"isBackground": true,
"problemMatcher": {
"owner": "custom",
"fileLocation": "absolute",
"pattern": [
{
// [2024/06/15 16:23:22] [ERROR] [antville-1] GET:main.css helma.scripting.ScriptingException: TypeError: Cannot find function getStaticFile in object HopObject Skin. (/home/tobi/Projects/helma/repo/./apps/antville/code/Site/Site.js#474)
"regexp": "^\\[.+\\] \\[(.+)\\] \\[.+\\] \\S+ \\s+: (.+) \\(([^#]+)#(\\d+)\\)$",
"severity": 1,
"message": 2,
"file": 3,
"line": 4
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "Listening for transport dt_socket at address",
"endsPattern": "terminated with exit code"
}
}
}
]
}

View file

@ -290,3 +290,11 @@ task commandLine(type: JavaExec) {
mainClass = 'helma.main.launcher.Commandline' mainClass = 'helma.main.launcher.Commandline'
args '-h', projectDir, function 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')
}