wscript
#! /usr/bin/env python
# encoding: utf-8
"""
The attribute run_str is assumed to be a string and will be compiled into
a method 'run' by a metaclass (that is, when the class is defined)
"""
def configure(ctx):
ctx.env.COPY = '/bin/cp'
ctx.env.COPYFLAGS = ['-f']
def build(ctx):
from waflib.Task import Task
class copy(Task):
run_str = '${COPY} ${COPYFLAGS} ${SRC} ${TGT}'
print(copy.vars)
tsk = copy(env=ctx.env)
tsk.set_inputs(ctx.path.find_resource('wscript'))
tsk.set_outputs(ctx.path.find_or_declare('b.out'))
ctx.add_to_group(tsk)