waf/docs/book/examples/tasks_groups2/wscript

33 lines
956 B
Python

#! /usr/bin/env python
"""
waf configure clean build -j4 --dwidth=800 --dtitle='Parallel build representation for "waf -j4"'
for this to work, make sure to either use waf git or to create waf with './waf-light --make-waf --tools=compat15,parallel_debug'
"""
def options(ctx):
ctx.load('parallel_debug')
def configure(ctx):
ctx.load('parallel_debug')
def build(ctx):
ctx.add_group('group1')
ctx.add_group('group2')
for i in range(8):
ctx.set_group('group1')
ctx(rule='cp ${SRC} ${TGT}', source='wscript', target='wscript_a_%d' % i,
color='YELLOW', name='tasks a')
ctx(rule='cp ${SRC} ${TGT}', source='wscript_a_%d' % i, target='wscript_b_%d' % i,
color='GREEN', name='tasks b')
ctx.set_group('group2')
ctx(rule='cp ${SRC} ${TGT}', source='wscript', target='wscript_c_%d' % i,
color='BLUE', name='tasks c')
ctx(rule='cp ${SRC} ${TGT}', source='wscript_c_%d' % i, target='wscript_d_%d' % i,
color='PINK', name='tasks d')