You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
waf_old/docs/book/examples/tasks_weak/wscript

31 lines
785 B
Python

#! /usr/bin/env python
"""
Illustrate the effect of weak order constraints for the build (generates diagrams)
waf configure clean build -j2 --dwidth=800 --dtitle='No particular order for "waf -j2"' --dmaxtime=7.08
waf configure clean build -j2 --dwidth=800 --dtitle='Weak order for "waf -j2"' --dmaxtime=7.08
"""
def options(ctx):
ctx.load('parallel_debug')
def configure(ctx):
ctx.load('parallel_debug')
def build(ctx):
for x in range(5):
ctx(rule='sleep 1', color='GREEN', name='short task')
ctx(rule='sleep 5', color='RED', name='long task')
import random
from waflib import Task
old = Task.set_file_constraints
def meth(lst):
lst.sort(cmp=lambda x, y: cmp(x.__class__.__name__, y.__class__.__name__))
#random.shuffle(lst)
old(lst)
Task.set_file_constraints = meth