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

stale.py improvements

This commit is contained in:
Thomas Nagy 2014-10-30 07:49:59 +01:00
parent 046c55a97e
commit 2e98ef1313
No known key found for this signature in database
GPG Key ID: 67A565EDFDF90E64
2 changed files with 12 additions and 9 deletions

View File

@ -98,10 +98,9 @@ Here is how to tune the build groups:
[source,python]
---------------
def build(ctx):
from waflib.Build import POST_LAZY, POST_BOTH, POST_AT_ONCE
from waflib.Build import POST_LAZY, POST_AT_ONCE
ctx.post_mode = POST_AT_ONCE <1>
#ctx.post_mode = POST_LAZY <2>
#ctx.post_mode = POST_BOTH <3>
---------------
<1> All task generators create their tasks before the build starts (default behaviour)

View File

@ -25,19 +25,19 @@ def refill_task_list(self):
iit = old(self)
bld = self.bld
# execute this operation only once
if getattr(self, 'stale_done', False):
return iit
self.stale_done = True
# this does not work in partial builds
if bld.options.targets and bld.options.targets != '*':
if hasattr(bld, 'options') and bld.options.targets and bld.options.targets != '*':
return iit
# this does not work in dynamic builds
if bld.post_mode == Build.POST_LAZY:
if not hasattr(bld, 'post_mode') or bld.post_mode == Build.POST_LAZY:
return iit
# execute this operation only once - using refill_task_list is
if getattr(self, 'clean', False):
return iit
self.clean = True
# obtain the nodes to use during the build
nodes = []
for i in range(len(bld.groups)):
@ -50,6 +50,10 @@ def refill_task_list(self):
# recursion over the nodes to find the stale files
def iter(node):
if node.abspath() in bld.env[Build.CFG_FILES]:
return
if getattr(node, 'children', []):
for x in node.children.values():
if x.name != "c4che":