2
0
mirror of https://gitlab.com/ita1024/waf.git synced 2024-11-22 09:57: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 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 * Make lazy visual studio detection the default
* Do not cache waf tool detection * Do not cache waf tool detection
* Fix the vala detection * Fix the vala detection
* Better consistency between check_cfg and check_cc variables * 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 * 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 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 from waflib import Task
# TODO update_outputs is a decorator too .. now class foo(Task.Task):
@Task.always_run always_run = True
class foo_task(Task.Task):
def run(self): def run(self):
print("running foo") print("running foo")

View File

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

View File

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