waf: create ap_version taskgen in the corresponding function

This commit is contained in:
Gustavo Jose de Sousa 2016-07-28 13:53:01 -03:00 committed by Lucas De Marchi
parent 2e1ac0de8d
commit 5ccd3dfec8
1 changed files with 11 additions and 12 deletions

23
wscript
View File

@ -252,6 +252,17 @@ def _build_dynamic_sources(bld):
],
)
def write_version_header(tsk):
bld = tsk.generator.bld
return bld.write_version_header(tsk.outputs[0].abspath())
bld(
name='ap_version',
target='ap_version.h',
vars=['AP_VERSION_ITEMS'],
rule=write_version_header,
)
bld.env.prepend_value('INCLUDES', [
bld.bldnode.abspath(),
])
@ -319,10 +330,6 @@ def _build_recursion(bld):
for d in dirs_to_recurse:
bld.recurse(d)
def _write_version_header(tsk):
bld = tsk.generator.bld
return bld.write_version_header(tsk.outputs[0].abspath())
def _build_post_funs(bld):
if bld.cmd == 'check':
bld.add_post_fun(ardupilotwaf.test_summary)
@ -357,14 +364,6 @@ def build(bld):
_build_recursion(bld)
bld(
name='ap_version',
target='ap_version.h',
vars=['AP_VERSION_ITEMS'],
rule=_write_version_header,
group='dynamic_sources',
)
_build_post_funs(bld)
ardupilotwaf.build_command('check',