diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 8c690ceee46..af3d1adfef3 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -26,6 +26,72 @@ "message": 5 } } + }, + { + "label": "run all unit tests for the apollo project", + "type": "shell", + // you can change the "build" option to others acording to the "apollo.sh" file + "command": "bash apollo_docker.sh test", + // format the error message + "problemMatcher": { + "owner": "cc", + "fileLocation": [ + "relative", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + }, + { + "label": "code style check for the apollo project", + "type": "shell", + // you can change the "build" option to others acording to the "apollo.sh" file + "command": "bash apollo_docker.sh lint", + // format the error message + "problemMatcher": { + "owner": "cc", + "fileLocation": [ + "relative", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } + }, + { + "label": "clean the apollo project", + "type": "shell", + // you can change the "build" option to others acording to the "apollo.sh" file + "command": "bash apollo_docker.sh clean", + // format the error message + "problemMatcher": { + "owner": "cc", + "fileLocation": [ + "relative", + "${workspaceFolder}" + ], + "pattern": { + "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$", + "file": 1, + "line": 2, + "column": 3, + "severity": 4, + "message": 5 + } + } } ] } \ No newline at end of file diff --git a/apollo_docker.sh b/apollo_docker.sh index c4eabd66eea..2baa4d9a8fb 100755 --- a/apollo_docker.sh +++ b/apollo_docker.sh @@ -49,10 +49,10 @@ function start_build_docker() { docker ps --format "{{.Names}}" | grep apollo_dev 1>/dev/null 2>&1 if [ $? != 0 ]; then # If Google is reachable, we fetch the docker image directly. - if ping -q -c 1 -W 1 www.google.com >/dev/null; then + if ping -q -c 1 -W 1 www.google.com 1>/dev/null 2>&1; then opt="" # If Google is unreachable but Baidu reachable, we fetch the docker image from China. - elif ping -q -c 1 -W 1 www.baidu.com >/dev/null; then + elif ping -q -c 1 -W 1 www.baidu.com 1>/dev/null 2>&1; then opt="-C" # If Baidu is unreachable, we use local images. else diff --git a/docs/howto/how_to_build_and_release.md b/docs/howto/how_to_build_and_release.md index 3c89d9adbf2..9fab4a72c27 100644 --- a/docs/howto/how_to_build_and_release.md +++ b/docs/howto/how_to_build_and_release.md @@ -48,7 +48,7 @@ The command will push your most recent release docker image to the docker hub. ## Build in Visual Studio Code ### Install VSCode -The easiest way to install for Debian/Ubuntu based distributions is to download in https://code.visualstudio.com and install the .deb package (64-bit) either through the graphical software center if it's available or through the command line with: +The easiest way to install for Debian/Ubuntu based distributions is to download from https://code.visualstudio.com and install the .deb package (64-bit) either through the graphical software center if it's available or through the command line with: ```bash sudo dpkg -i .deb sudo apt-get install -f # Install dependencies @@ -62,8 +62,14 @@ code Use the keyboard shortcut (Ctrl+K Ctrl+O) to open the Apollo project. ### Build the Apollo project in VSCode Use the keyboard shortcut (Ctrl+Shift+B) to build the Apollo project. +### Run all unit tests for the Apollo project in VSCode +Select the "Tasks->Run Tasks..." menu command and click "run all unit tests for the apollo project" from a popup menu to check the code style for the Apollo project. +### Run a code style check task for the Apollo project in VSCode +Select the "Tasks->Run Tasks..." menu command and click "code style check for the apollo project" from a popup menu to check the code style for the Apollo project. +### Clean the Apollo project in VSCode +Select the "Tasks->Run Tasks..." menu command and click "clean the apollo project" from a popup menu to clean the Apollo project. ### Change the building option - you can change the "build" option to an other one such as "build_gpu" (refer to the "apollo.sh" file for details) in ".vscode/tasks.json" + You can change the "build" option to another one such as "build_gpu" (refer to the "apollo.sh" file for details) in ".vscode/tasks.json" ## Test ```bash