Skip to content

Commit

Permalink
More vscode tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
gbevin committed Feb 25, 2024
1 parent 30101af commit e6feeff
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 25 deletions.
11 changes: 11 additions & 0 deletions src/main/java/rife/bld/operations/AbstractCreateOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,17 @@ protected boolean createIdeaRunMain() {
*/
protected void executePopulateVscodeProject()
throws FileUtilsErrorException {
var launch_template = TemplateFactory.JSON.get(templateBase_ + "vscode.launch");
launch_template.setValue("package", project_.pkg());
if (launch_template.hasValueId("projectMain")) {
launch_template.setValue("projectMain", projectMainName_);
}
if (launch_template.hasValueId("projectTest")) {
launch_template.setValue("projectTest", projectTestName_);
}
var launch_file = new File(vscodeDirectory_, "launch.json");
FileUtils.writeString(launch_template.getContent(), launch_file);

var settings_template = TemplateFactory.JSON.get(templateBase_ + "vscode.settings");
if (settings_template.hasValueId("version")) {
settings_template.setValue("version", BldVersion.getVersion());
Expand Down
24 changes: 24 additions & 0 deletions src/main/resources/templates/bld/app/vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Run Main",
"request": "launch",
"mainClass": "{{v package/}}.{{v projectMain/}}"
},
{
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "org.junit.platform.console.ConsoleLauncher",
"args": [
"--details=verbose",
"--scan-classpath",
"--disable-banner",
"--disable-ansi-colors",
"--exclude-engine=junit-platform-suite",
"--exclude-engine=junit-vintage"]
}
]
}
9 changes: 3 additions & 6 deletions src/main/resources/templates/bld/app/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
"src/main/java",
"src/main/resources",
"src/test/java",
"src/bld/java"
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-{{v version/}}.jar",
"lib/bld/*.jar",
"lib/compile/*.jar",
"lib/provided/*.jar",
"lib/runtime/*.jar",
"lib/test/*.jar"
"lib/**/*.jar",
]
}
17 changes: 17 additions & 0 deletions src/main/resources/templates/bld/base/vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Run Main",
"request": "launch",
"mainClass": "{{v package/}}.{{v projectMain/}}"
},
{
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "{{v package/}}.{{v projectTest/}}"
}
]
}
9 changes: 3 additions & 6 deletions src/main/resources/templates/bld/base/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
"src/main/java",
"src/main/resources",
"src/test/java",
"src/bld/java"
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-{{v version/}}.jar",
"lib/bld/*.jar",
"lib/compile/*.jar",
"lib/provided/*.jar",
"lib/runtime/*.jar",
"lib/test/*.jar"
"lib/**/*.jar",
]
}
11 changes: 11 additions & 0 deletions src/main/resources/templates/bld/lib/vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "{{v package/}}.{{v projectTest/}}"
}
]
}
9 changes: 3 additions & 6 deletions src/main/resources/templates/bld/lib/vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
"src/main/java",
"src/main/resources",
"src/test/java",
"src/bld/java"
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-{{v version/}}.jar",
"lib/bld/*.jar",
"lib/compile/*.jar",
"lib/provided/*.jar",
"lib/runtime/*.jar",
"lib/test/*.jar"
"lib/**/*.jar",
]
}
24 changes: 24 additions & 0 deletions src/main/resources/templates/bld/rife2_hello/vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "Run Main",
"request": "launch",
"mainClass": "{{v package/}}.{{v projectMain/}}"
},
{
"type": "java",
"name": "Run Tests",
"request": "launch",
"mainClass": "org.junit.platform.console.ConsoleLauncher",
"args": [
"--details=verbose",
"--scan-classpath",
"--disable-banner",
"--disable-ansi-colors",
"--exclude-engine=junit-platform-suite",
"--exclude-engine=junit-vintage"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
"src/main/resources",
"src/main/webapp",
"src/test/java",
"src/bld/java"
"src/bld/java",
"src/bld/resources"
],
"java.configuration.updateBuildConfiguration": "automatic",
"java.project.referencedLibraries": [
"${HOME}/.bld/dist/bld-{{v version/}}.jar",
"lib/bld/*.jar",
"lib/compile/*.jar",
"lib/provided/*.jar",
"lib/runtime/*.jar",
"lib/standalone/*.jar",
"lib/test/*.jar"
"lib/**/*.jar",
]
}
5 changes: 5 additions & 0 deletions src/test/java/rife/bld/operations/TestCreateAppOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -156,6 +157,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -257,6 +259,7 @@ void testExecuteNoDownload()
/yourthing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode
/yourthing/.vscode/launch.json
/yourthing/.vscode/settings.json
/yourthing/bld
/yourthing/bld.bat
Expand Down Expand Up @@ -353,6 +356,7 @@ void testExecuteLocalDependencies()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -473,6 +477,7 @@ void testExecuteLocalDependenciesFolders()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -131,6 +132,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -214,6 +216,7 @@ void testExecuteNoDownload()
/yourthing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode
/yourthing/.vscode/launch.json
/yourthing/.vscode/settings.json
/yourthing/bld
/yourthing/bld.bat
Expand Down Expand Up @@ -267,6 +270,7 @@ void testExecuteNoDownload()
/yourthing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode
/yourthing/.vscode/launch.json
/yourthing/.vscode/settings.json
/yourthing/bld
/yourthing/bld.bat
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/rife/bld/operations/TestCreateLibOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -147,6 +148,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -194,6 +195,7 @@ void testExecute()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -336,6 +338,7 @@ void testExecuteNoDownload()
/yourthing/.idea/runConfigurations/Run Main.xml
/yourthing/.idea/runConfigurations/Run Tests.xml
/yourthing/.vscode
/yourthing/.vscode/launch.json
/yourthing/.vscode/settings.json
/yourthing/bld
/yourthing/bld.bat
Expand Down Expand Up @@ -446,6 +449,7 @@ void testExecuteLocalDependencies()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down Expand Up @@ -613,6 +617,7 @@ void testExecuteLocalDependenciesFolders()
/myapp/\\.idea/runConfigurations/Run Main\\.xml
/myapp/\\.idea/runConfigurations/Run Tests\\.xml
/myapp/\\.vscode
/myapp/\\.vscode/launch\\.json
/myapp/\\.vscode/settings\\.json
/myapp/bld
/myapp/bld\\.bat
Expand Down

0 comments on commit e6feeff

Please sign in to comment.