source files using the supplied action. Action may
be any type that the Builder constructor will accept
for an action."""
- builder_kw = {
- 'action' : action,
- 'source_factory' : self.fs.Entry,
- }
- builder_kw.update(kw)
- bld = apply(SCons.Builder.Builder, (), builder_kw)
+ bld = SCons.Builder.Builder(action = action,
+ source_factory = self.fs.Entry)
return apply(bld, (self, target, source), kw)
def Depends(self, target, dependency):
assert str(t) == 'xxx.out', str(t)
assert 'xxx.in' in map(lambda x: x.path, t.sources)
- # Make sure we can use Builder keyword arguments
- # on Command() calls.
- env.Command(target='mmm.out', source='mmm.1.in',
- action='multibuild', multi=1)
- env.Command(target='mmm.out', source='mmm.2.in',
- action='multibuild', multi=1)
-
def test_Configure(self):
"""Test the Configure() method"""
# Configure() will write to a local temporary file.
##########################################################
# Test scanner as found automatically from the environment
+# (backup_source_scanner)
env = Environment()
env.Append(SCANNERS = kscan)
env2.Command('junk', 'junk.k2', r'%(python)s build.py $SOURCES $TARGET')
##########################################################
-# Test specifying a specific source scanner for a Builder
+# Test specifying a specific source scanner for a target Node
-bar = env.Command('bar', 'bar.in',
- r'%(python)s build.py $SOURCES $TARGET',
- source_scanner=kscan)
+barbld = Builder(action=r'%(python)s build.py $SOURCES $TARGET',
+ source_scanner=kscan)
+env.Append(BUILDERS={'BarBld':barbld})
+bar = env.BarBld(target='bar', source='bar.in')
##########################################################
-# Test specifying a source scanner for an intermediary Builder to
-# ensure that the right scanner gets used for the right nodes.
+# Test specifying a source scanner for a Builder that gets
+# automatically applied to targets generated from that Builder
import string