Skip to content

Commit 27d743d

Browse files
committed
First attempt
This does not really work at all. The fwcd Kotlin plugin does not support setting a current working directory in launch.json, which is an issue since the project requires being in android/assets. Someone almost added this, but has been stale for 4 years: fwcd/vscode-kotlin#42
1 parent d2148d4 commit 27d743d

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

.vscode/debug_desktop.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@echo off
2+
start cmd /k "cd /d %~dp0\.. && .\gradlew :desktop:debug"
3+
ping 127.0.0.1 -n 4 > nul

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"fwcd.kotlin",
4+
"vscjava.vscode-java-pack"
5+
]
6+
}

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "kotlin",
6+
"request": "attach",
7+
"name": "Debug Desktop (Attach)",
8+
"hostName": "localhost",
9+
"projectRoot": "${workspaceFolder}",
10+
"port": 5005,
11+
"timeout": 30000,
12+
"preLaunchTask": "debug_desktop"
13+
14+
},
15+
{
16+
"type": "kotlin",
17+
"request": "launch",
18+
"name": "Debug Desktop",
19+
"projectRoot": "${workspaceFolder}/desktop",
20+
"mainClass": "com.unciv.app.desktop.DesktopLauncher",
21+
}
22+
]
23+
}

.vscode/tasks.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "build_all",
6+
"type": "shell",
7+
"command": "./gradlew build",
8+
"problemMatcher": [],
9+
"group": {
10+
"kind": "build",
11+
"isDefault": true
12+
}
13+
},
14+
{
15+
"label": "build_core",
16+
"type": "shell",
17+
"command": "./gradlew :core:build",
18+
"problemMatcher": [],
19+
"group": {
20+
"kind": "build",
21+
}
22+
},
23+
{
24+
"label": "build_desktop",
25+
"type": "shell",
26+
"command": "./gradlew :desktop:build",
27+
"problemMatcher": [],
28+
"group": {
29+
"kind": "build",
30+
}
31+
},
32+
{
33+
"label": "debug_desktop",
34+
"type": "shell",
35+
"command": "${workspaceFolder}\\.vscode\\debug_desktop.bat",
36+
"problemMatcher": [],
37+
"dependsOrder": "sequence",
38+
"dependsOn": [
39+
"build_core",
40+
"build_desktop"
41+
]
42+
},
43+
]
44+
}
45+

0 commit comments

Comments
 (0)