Skip to content

Commit

Permalink
fbt: added support for FBT_NO_SYNC environment variable to skip submo…
Browse files Browse the repository at this point in the history
…dule update at start (flipperdevices#1363)
  • Loading branch information
hedger authored Jul 4, 2022
1 parent 6b6ea44 commit 43fd2e4
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 225 deletions.
33 changes: 0 additions & 33 deletions assets/compiled/gpio.pb.c

This file was deleted.

183 changes: 0 additions & 183 deletions assets/compiled/gpio.pb.h

This file was deleted.

5 changes: 4 additions & 1 deletion documentation/fbt.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ Make sure that `gcc-arm-none-eabi` toolchain & OpenOCD executables are in system

## NB

FBT constructs all referenced environments & their targets' dependency trees on startup. So, to keep startup time as low as possible, we're hiding construction of certain targets behind command-line options.
* `fbt` constructs all referenced environments & their targets' dependency trees on startup. So, to keep startup time as low as possible, we're hiding construction of certain targets behind command-line options.
* `fbt` always performs `git submodule update --init` on start, unless you set `FBT_NO_SYNC=1` in environment:
* On Windows, that's `set "FBT_NO_SYNC=1"` in the shell you're running `fbt` from
* On \*nix, it's `$ FBT_NO_SYNC=1 ./fbt ...`

## Invoking FBT

Expand Down
13 changes: 7 additions & 6 deletions fbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ set -e
SCRIPTDIR="$( dirname -- "$0"; )";
SCONS_EP=${SCRIPTDIR}/lib/scons/scripts/scons.py

if [[ -d .git ]]; then
git submodule update --init
else # Not in a git repo
echo Not in a git repo, please clone with git clone --recursive
# Return error code 1 to indicate failure
exit 1
if [[ -z "${FBT_NO_SYNC:-}" ]] ; then
if [[ -d .git ]]; then
git submodule update --init
else
echo Not in a git repo, please clone with git clone --recursive
exit 1
fi
fi

SCONS_DEFAULT_FLAGS="-Q --warn=target-not-built"
Expand Down
9 changes: 7 additions & 2 deletions fbt.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@

set SCONS_EP=%~dp0\lib\scons\scripts\scons.py

if exist ".git" (
git submodule update --init
if [%FBT_NO_SYNC%] == [] (
if exist ".git" (
git submodule update --init
) else (
echo Not in a git repo, please clone with git clone --recursive
exit /b 1
)
)

set "SCONS_DEFAULT_FLAGS=-Q --warn=target-not-built"
Expand Down

0 comments on commit 43fd2e4

Please sign in to comment.