mirror of https://gitlab.com/ita1024/waf.git
stale.py improvements
This commit is contained in:
parent
046c55a97e
commit
2e98ef1313
|
@ -98,10 +98,9 @@ Here is how to tune the build groups:
|
||||||
[source,python]
|
[source,python]
|
||||||
---------------
|
---------------
|
||||||
def build(ctx):
|
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_AT_ONCE <1>
|
||||||
#ctx.post_mode = POST_LAZY <2>
|
#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)
|
<1> All task generators create their tasks before the build starts (default behaviour)
|
||||||
|
|
|
@ -25,19 +25,19 @@ def refill_task_list(self):
|
||||||
iit = old(self)
|
iit = old(self)
|
||||||
bld = self.bld
|
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
|
# 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
|
return iit
|
||||||
|
|
||||||
# this does not work in dynamic builds
|
# 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
|
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
|
# obtain the nodes to use during the build
|
||||||
nodes = []
|
nodes = []
|
||||||
for i in range(len(bld.groups)):
|
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
|
# recursion over the nodes to find the stale files
|
||||||
def iter(node):
|
def iter(node):
|
||||||
|
|
||||||
|
if node.abspath() in bld.env[Build.CFG_FILES]:
|
||||||
|
return
|
||||||
|
|
||||||
if getattr(node, 'children', []):
|
if getattr(node, 'children', []):
|
||||||
for x in node.children.values():
|
for x in node.children.values():
|
||||||
if x.name != "c4che":
|
if x.name != "c4che":
|
||||||
|
|
Loading…
Reference in New Issue