build: add command to output currently configured board

./waf board now shows what's the currently configured board. Same as
    grep "'board':" build/.lock-waf*

but in a more pleasant way.
This commit is contained in:
Lucas De Marchi 2018-03-27 01:13:50 -07:00
parent 3ecc138c86
commit 7c068ee8ef

11
wscript
View File

@ -253,6 +253,17 @@ def collect_dirs_to_recurse(bld, globs, **kw):
def list_boards(ctx):
print(*boards.get_boards_names())
def board(ctx):
env = ConfigSet.ConfigSet()
try:
p = os.path.join(Context.out_dir, Build.CACHE_DIR, Build.CACHE_SUFFIX)
env.load(p)
except:
print('No board currently configured')
return
print('Board configured to: {}'.format(env.VARIANT))
def _build_cmd_tweaks(bld):
if bld.cmd == 'check-all':
bld.options.all_tests = True