2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-12-12 11:51:15 +01:00
waf/docs/book/examples/tasks_copy/wscript
2011-09-10 11:13:51 +02:00

23 lines
435 B
Python

#! /usr/bin/env python
"""
Simple copy task
The attribute 'run_str' is compiled into the task method 'run' by a metaclass
"""
def configure(ctx):
pass
def build(ctx):
from waflib import Task
class copy(Task.Task):
run_str = 'cp ${SRC} ${TGT}'
copy = Task.always_run(copy)
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)