mirror of https://gitlab.com/ita1024/waf.git
Simplify task.inputs/task.outputs usage
This commit is contained in:
parent
0c541f606a
commit
1c3c49d0fb
|
@ -1372,11 +1372,11 @@ class StepContext(BuildContext):
|
|||
lst = tg.tasks
|
||||
for tsk in lst:
|
||||
do_exec = False
|
||||
for node in getattr(tsk, 'inputs', []):
|
||||
for node in tsk.inputs:
|
||||
if matcher(node, output=False):
|
||||
do_exec = True
|
||||
break
|
||||
for node in getattr(tsk, 'outputs', []):
|
||||
for node in tsk.outputs:
|
||||
if matcher(node, output=True):
|
||||
do_exec = True
|
||||
break
|
||||
|
|
|
@ -867,10 +867,12 @@ def set_file_constraints(tasks):
|
|||
ins = Utils.defaultdict(set)
|
||||
outs = Utils.defaultdict(set)
|
||||
for x in tasks:
|
||||
for a in getattr(x, 'inputs', []) + getattr(x, 'dep_nodes', []):
|
||||
ins[id(a)].add(x)
|
||||
for a in getattr(x, 'outputs', []):
|
||||
outs[id(a)].add(x)
|
||||
for a in x.inputs:
|
||||
ins[a].add(x)
|
||||
for a in x.dep_nodes:
|
||||
ins[a].add(x)
|
||||
for a in x.outputs:
|
||||
outs[a].add(x)
|
||||
|
||||
links = set(ins.keys()).intersection(outs.keys())
|
||||
for k in links:
|
||||
|
|
|
@ -313,7 +313,7 @@ def apply_qt5(self):
|
|||
|
||||
if getattr(self, 'update', None) and Options.options.trans_qt5:
|
||||
cxxnodes = [a.inputs[0] for a in self.compiled_tasks] + [
|
||||
a.inputs[0] for a in self.tasks if getattr(a, 'inputs', None) and a.inputs[0].name.endswith('.ui')]
|
||||
a.inputs[0] for a in self.tasks if a.inputs and a.inputs[0].name.endswith('.ui')]
|
||||
for x in qmtasks:
|
||||
self.create_task('trans_update', cxxnodes, x.inputs)
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class MakeContext(BuildContext):
|
|||
all_tasks.append(tsk)
|
||||
|
||||
do_exec = False
|
||||
for node in getattr(tsk, 'inputs', []):
|
||||
for node in tsk.inputs:
|
||||
try:
|
||||
uses[node].append(tsk)
|
||||
except:
|
||||
|
@ -66,7 +66,7 @@ class MakeContext(BuildContext):
|
|||
do_exec = True
|
||||
break
|
||||
|
||||
for node in getattr(tsk, 'outputs', []):
|
||||
for node in tsk.outputs:
|
||||
try:
|
||||
provides[node].append(tsk)
|
||||
except:
|
||||
|
@ -93,7 +93,7 @@ class MakeContext(BuildContext):
|
|||
result |= cur
|
||||
tosee = set()
|
||||
for tsk in cur:
|
||||
for node in getattr(tsk, 'inputs', []):
|
||||
for node in tsk.inputs:
|
||||
if node in seen:
|
||||
continue
|
||||
seen.add(node)
|
||||
|
|
|
@ -69,7 +69,7 @@ def get_next_task(self):
|
|||
break
|
||||
else:
|
||||
# so far so good, now consider the nodes
|
||||
for x in getattr(tsk, 'inputs', []) + getattr(tsk, 'deps', []):
|
||||
for x in tsk.inputs + getattr(tsk, 'deps', []):
|
||||
if x in canceled_nodes:
|
||||
tsk.hasrun = Task.CANCELED
|
||||
self.cancel_next(tsk)
|
||||
|
|
Loading…
Reference in New Issue