Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restyle [gn] Vscode integration. Fixes #1526. #1560

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
35 changes: 19 additions & 16 deletions gn_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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):'
Expand Down Expand Up @@ -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