diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 0cd88daedb8a84..3b1154935e33b5 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -17,6 +17,21 @@ }, "problemMatcher": ["$gcc"] }, + { + "label": "GN Build", + "type": "shell", + "command": "./gn_build.sh", + "group": { + "kind": "build", + "isDefault": true + }, + "isBackground": false, + "presentation": { + "reveal": "always", + "panel": "shared" + }, + "problemMatcher": ["$gcc"] + }, { "label": "Auto-enforce coding style", "type": "shell", diff --git a/gn_build.sh b/gn_build.sh index 77440d2a7dd20c..9aa9e9d5609db5 100755 --- a/gn_build.sh +++ b/gn_build.sh @@ -40,22 +40,7 @@ set +e source "$CHIP_ROOT/scripts/activate.sh" set -e -_chip_banner "Build: GN configure" - -nrf5_sdk_args="" -extra_args="" - -if [[ -d "$NRF5_SDK_ROOT/components/libraries" ]]; then - nrf5_sdk_args+="nrf5_sdk_root=\"$NRF5_SDK_ROOT\"" - extra_args+=" $nrf5_sdk_args enable_nrf5_builds=true" -fi - -gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/debug" --args='target_os="all"'"$extra_args" -gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/release" --args='target_os="all" is_debug=false'"$extra_args" - -_chip_banner "Build: Ninja build" - -time ninja -C "$CHIP_ROOT/out/debug" all check +_chip_banner "Instructions" echo echo 'To activate existing build environment in your shell, run (do this first):' @@ -91,3 +76,21 @@ else echo 'To build the nRF5 lock sample as a standalone project': echo "(cd $CHIP_ROOT/examples/lock-app/nrf5; gn gen out/debug --args='$nrf5_sdk_args'; ninja -C out/debug)" fi +echo + +_chip_banner "Build: GN configure" + +nrf5_sdk_args="" +extra_args="" + +if [[ -d "$NRF5_SDK_ROOT/components/libraries" ]]; then + nrf5_sdk_args+="nrf5_sdk_root=\"$NRF5_SDK_ROOT\"" + extra_args+=" $nrf5_sdk_args enable_nrf5_builds=true" +fi + +gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/debug" --args='target_os="all"'"$extra_args" +gn --root="$CHIP_ROOT" gen --check "$CHIP_ROOT/out/release" --args='target_os="all" is_debug=false'"$extra_args" + +_chip_banner "Build: Ninja build" + +time ninja -C "$CHIP_ROOT/out/debug" all check