mirror of https://gitlab.com/ita1024/waf.git
Remove the BuildContext.rule decorator
This commit is contained in:
parent
a5d2c5fe24
commit
fb01bf72ab
|
@ -4,3 +4,5 @@ NEW IN WAF 2.0.0
|
|||
* Removed ut_fun from waf_unit_test.py
|
||||
* Force files into the build directory by default
|
||||
|
||||
* Remove Node.sig and Node.cache_sig
|
||||
* Remove the BuildContext.rule decorator
|
||||
|
|
|
@ -175,30 +175,6 @@ class BuildContext(Context.Context):
|
|||
self.add_to_group(ret, group=kw.get('group'))
|
||||
return ret
|
||||
|
||||
def rule(self, *k, **kw):
|
||||
"""
|
||||
Wrapper for creating a task generator using the decorator notation. The following code::
|
||||
|
||||
@bld.rule(target="foo")
|
||||
def _(tsk):
|
||||
print("bar")
|
||||
|
||||
is equivalent to::
|
||||
|
||||
def bar(tsk):
|
||||
print("bar")
|
||||
|
||||
bld(
|
||||
target = "foo",
|
||||
rule = bar,
|
||||
)
|
||||
"""
|
||||
def f(rule):
|
||||
ret = self(*k, **kw)
|
||||
ret.rule = rule
|
||||
return ret
|
||||
return f
|
||||
|
||||
def __copy__(self):
|
||||
"""
|
||||
Build contexts cannot be copied
|
||||
|
|
Loading…
Reference in New Issue