2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 01:46:15 +01:00

Misleading attribute never_skip, replaced by always_run

This commit is contained in:
Thomas Nagy 2015-12-25 17:52:30 +01:00
parent 6aa1c74798
commit f73d3f1a2f
4 changed files with 12 additions and 12 deletions

8
TODO
View File

@ -1,15 +1,15 @@
Waf 1.9
-------
* Provide a more efficient ConfigSet implementation
* Ensure _cache.py are valid python files
* Rework qt5
* Make lazy visual studio detection the default
* Do not cache waf tool detection
* Fix the vala detection
* Better consistency between check_cfg and check_cc variables
* Use relative paths in apply_incpaths (and absolute ones when paths cross drives)
* Let more context commands depend on the configuration
* Rework qt5
* Use relative paths in apply_incpaths (and absolute ones when paths cross drives)
* Provide a more efficient ConfigSet implementation
* Ensure _cache.py are valid python files
and all other issues listed on https://github.com/waf-project/waf/issues

View File

@ -39,9 +39,8 @@ def bar(ctx):
from waflib import Task
# TODO update_outputs is a decorator too .. now
@Task.always_run
class foo_task(Task.Task):
class foo(Task.Task):
always_run = True
def run(self):
print("running foo")

View File

@ -402,8 +402,8 @@ class Task(TaskBase):
vars = []
"""Variables to depend on (class attribute used for :py:meth:`waflib.Task.Task.sig_vars`)"""
never_skip = False
"""Specify whether task instances must always be executed or not, leave empty or set to :py:const:`waflib.Task.RUN_ME`"""
always_run = False
"""Specify whether task instances must always be executed or not"""
shell = False
"""Execute the command with the shell (class attribute)"""
@ -613,7 +613,7 @@ class Task(TaskBase):
Logs.debug("task: task %r must run: an output node does not exist" % self)
return RUN_ME
return self.never_skip or SKIP_ME
return (self.always_run and RUN_ME) or SKIP_ME
def post_run(self):
"""
@ -1136,7 +1136,8 @@ def always_run(cls):
The task signature is calculated, but the result of the comparison between
task signatures is bypassed
"""
cls.never_skip = RUN_ME
Logs.warn('This decorator is deprecated, set always_run on the task class instead!')
cls.always_run = True
return cls
def update_outputs(cls):

View File

@ -593,7 +593,7 @@ def process_rule(self):
Task.update_outputs(cls)
if getattr(self, 'always', None):
Task.always_run(cls)
cls.always_run = True
for x in ('after', 'before', 'ext_in', 'ext_out'):
setattr(cls, x, getattr(self, x, []))