I have two Tasks in waf
and they need to be exectued in the correct order, and the second task, has to wait until the first task has finished.
To show that it's behaving the way I expected it to work, I wait inside the tasks, in the first task (t_1
) 4 seconds and in the second task (t_2
) 1 second. And the second task finishes first. This can be seen, as the folders I create after waiting have timestamps t_2 < t_1
.
In one Question:
How can I tell waf, that t_2
is exectued after t_1
finished successfully?
MWE: wscript
from waflib import Context, Options from waflib import Task, TaskGen from waflib.Tools.compiler_c import c_compiler def options(opt): opt.load('compiler_c') def configure(cnf): cnf.load('compiler_c') def build(bld): bld.program(features=['t_1', 't_2'], source='main.c', target='abc') class t_1(Task.Task): always_run = True run_str = 'echo start t_1 && python -c "import time; time.sleep(4)" && echo end t_1 && mkdir t_1' color = 'RED' @TaskGen.feature('t_1') @TaskGen.after('apply_link') @TaskGen.before('t_2') def add_t_1_task(self): self.create_task('t_1') class t_2(Task.Task): always_run = True run_str = 'echo start t_2 && python -c "import time; time.sleep(1)" && echo end t_2 && mkdir t_2' color = 'RED' @TaskGen.feature('t_2') @TaskGen.after('apply_link', 't_1') def add_t_2_task(self): self.create_task('t_2')