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_values2/wscript

24 lines
557 B
Python

#! /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)