forked from zed-extensions/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.json
More file actions
53 lines (53 loc) · 2.51 KB
/
tasks.json
File metadata and controls
53 lines (53 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
[
{
"label": "Run $ZED_CUSTOM_java_class_name",
"command": "pkg=\"${ZED_CUSTOM_java_package_name:}\"; cls=\"$ZED_CUSTOM_java_class_name\"; if [ -n \"$pkg\" ]; then c=\"$pkg.$cls\"; else c=\"$cls\"; fi; if [ -f pom.xml ]; then ./mvnw clean compile exec:java -Dexec.mainClass=\"$c\"; elif [ -f gradlew ]; then ./gradlew run -PmainClass=\"$c\"; else find . -name '*.java' -not -path './bin/*' -not -path './target/*' -not -path './build/*' -print0 | xargs -0 javac -d bin && java -cp bin \"$c\"; fi;",
"use_new_terminal": false,
"reveal": "always",
"tags": ["java-main"],
"shell": {
"with_arguments": {
"program": "/bin/sh",
"args": ["-c"]
}
}
},
{
"label": "$ZED_CUSTOM_java_class_name.${ZED_CUSTOM_java_outer_class_name:}.$ZED_CUSTOM_java_method_name",
"command": "package=\"$ZED_CUSTOM_java_package_name\"; outer=\"${ZED_CUSTOM_java_outer_class_name:}\"; inner=\"$ZED_CUSTOM_java_class_name\"; method=\"$ZED_CUSTOM_java_method_name\"; sep=\"$\"; if [ -n \"$outer\" ]; then c=\"$outer$sep$inner\"; else c=\"$inner\"; fi; if [ -f pom.xml ]; then ./mvnw clean test -Dtest=\"$package.$c#$method\"; elif [ -f gradlew ]; then ./gradlew test --tests \"$package.$c.$method\"; else >&2 echo 'No build system found'; exit 1; fi;",
"use_new_terminal": false,
"reveal": "always",
"tags": ["java-test-method", "java-test-method-nested"],
"shell": {
"with_arguments": {
"program": "/bin/sh",
"args": ["-c"]
}
}
},
{
"label": "Test class $ZED_CUSTOM_java_class_name",
"command": "package=\"$ZED_CUSTOM_java_package_name\"; outer=\"${ZED_CUSTOM_java_outer_class_name:}\"; inner=\"$ZED_CUSTOM_java_class_name\"; sep=\"$\"; if [ -n \"$outer\" ]; then c=\"$outer$sep$inner\"; else c=\"$inner\"; fi; if [ -f pom.xml ]; then ./mvnw clean test -Dtest=\"$package.$c\"; elif [ -f gradlew ]; then ./gradlew test --tests \"$package.$c\"; else >&2 echo 'No build system found'; exit 1; fi;",
"use_new_terminal": false,
"reveal": "always",
"tags": ["java-test-class", "java-test-class-nested"],
"shell": {
"with_arguments": {
"program": "/bin/sh",
"args": ["-c"]
}
}
},
{
"label": "Run tests",
"command": "if [ -f pom.xml ]; then ./mvnw clean test; elif [ -f gradlew ]; then ./gradlew test; else >&2 echo 'No build system found'; exit 1; fi;",
"use_new_terminal": false,
"reveal": "always",
"shell": {
"with_arguments": {
"program": "/bin/sh",
"args": ["-c"]
}
}
}
]