class BuildTask(SCons.Taskmaster.Task):
"""An SCons build task."""
def execute(self):
- if self.target.get_state() == SCons.Node.up_to_date:
+ if self.targets[0].get_state() == SCons.Node.up_to_date:
if self.top:
- print 'scons: "%s" is up to date.' % str(self.target)
+ print 'scons: "%s" is up to date.' % str(self.targets[0])
else:
try:
- self.target.build()
+ self.targets[0].build()
except BuildError, e:
sys.stderr.write("scons: *** [%s] %s\n" % (e.node, e.errstr))
if e.errstr == 'Exception':
# this method is serialized, but execute isn't:
if print_tree and self.top:
print
- print SCons.Util.render_tree(self.target, get_children)
-
+ print SCons.Util.render_tree(self.targets[0], get_children)
def failed(self):
global ignore_errors
class CleanTask(SCons.Taskmaster.Task):
"""An SCons clean task."""
def execute(self):
- if self.target.builder:
- os.unlink(self.target.path)
- print "Removed " + self.target.path
+ if self.targets[0].builder:
+ os.unlink(self.targets[0].path)
+ print "Removed " + self.targets[0].path
+ try:
+ for t in self.targets[1:]:
+ os.unlink(t.path)
+ except IndexError:
+ pass
# Global variables
pending = filter(lambda x: x.get_state() == SCons.Node.pending,
nodes.keys())
tasks = {}
- for t in map(lambda r: r.task, ready):
+ for t in map(lambda r: r.task, pending):
tasks[t] = 1
self.tm.pending_remove(tasks.keys())
test.write(['subdir', 'f4.in'], "f4.in\n")
test.run(arguments = 'subdir')
+print test.stdout()
+print test.stderr()
test.fail_test(test.read(['subdir', 'f1.out']) != "f1.in\n")
test.fail_test(test.read(['subdir', 'f2.out']) != "f2.in\n")