From: stevenknight Date: Thu, 16 Dec 2004 13:29:10 +0000 (+0000) Subject: Restore older recipe for creating env.Command() builders while a better solution... X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=1bff9f4660f8124d336e79abe35a99a206030e87;p=scons.git Restore older recipe for creating env.Command() builders while a better solution is coded. git-svn-id: http://scons.tigris.org/svn/scons/trunk@1189 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py index d973a011..ca543bd6 100644 --- a/src/engine/SCons/Environment.py +++ b/src/engine/SCons/Environment.py @@ -1141,12 +1141,8 @@ class Base: 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): diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py index 56c42cbc..71383e7a 100644 --- a/src/engine/SCons/EnvironmentTests.py +++ b/src/engine/SCons/EnvironmentTests.py @@ -2001,13 +2001,6 @@ f5: \ 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. diff --git a/test/Scanner.py b/test/Scanner.py index 7936e59c..6e64c030 100644 --- a/test/Scanner.py +++ b/test/Scanner.py @@ -88,6 +88,7 @@ k2scan = env.Scanner(name = 'k2', ########################################################## # Test scanner as found automatically from the environment +# (backup_source_scanner) env = Environment() env.Append(SCANNERS = kscan) @@ -102,15 +103,16 @@ env2.Append(SCANNERS = [k2scan]) 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