Add Action() and Scanner() the list of global variables.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 15 Jan 2002 18:57:52 +0000 (18:57 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Tue, 15 Jan 2002 18:57:52 +0000 (18:57 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@209 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Script/SConscript.py
test/SConscript.py

index 70e30be1d4e112391d399d6d019fe670684ef8d5..f87056fdc78d7cf343e34bcfa46e981a09acd89a 100644 (file)
@@ -23,6 +23,9 @@ RELEASE 0.04 -
   - Function action fixes:  None is now a successful return value.
     Exceptions are now reported.  Document function actions.
 
+  - Add 'Action' and 'Scanner' to the global keywords so SConscript
+    files can use them too.
+
 
 
 RELEASE 0.03 - Fri, 11 Jan 2002 01:09:30 -0600
index 4208ebaabf64a660457e905bb1fa993c7a031c03..8ba64d1d291a64f8c2aabed960ded6be7c63ad68 100644 (file)
@@ -36,6 +36,7 @@ import SCons.Defaults
 import SCons.Node
 import SCons.Node.FS
 import SCons.Environment
+import SCons.Scanner
 import SCons.Action
 import string
 import sys
@@ -161,21 +162,23 @@ def BuildDefaultGlobals():
     """
 
     globals = {}
-    globals['Builder'] = SCons.Builder.Builder
-    globals['Environment'] = SCons.Environment.Environment
-    globals['Object'] = SCons.Defaults.Object
-    globals['Program'] = SCons.Defaults.Program
-    globals['Library'] = SCons.Defaults.Library
-    globals['CScan'] = SCons.Defaults.CScan
-    globals['SConscript'] = SConscript
-    globals['Default'] = Default
-    globals['Help'] = Help
-    globals['BuildDir'] = BuildDir
-    globals['GetBuildPath'] = GetBuildPath
-    globals['Export'] = Export
-    globals['Import'] = Import
-    globals['Return'] = Return
-    globals['Dir'] = SCons.Node.FS.default_fs.Dir
-    globals['File'] = SCons.Node.FS.default_fs.File
+    globals['Action']            = SCons.Action.Action
+    globals['BuildDir']          = BuildDir
+    globals['Builder']           = SCons.Builder.Builder
+    globals['CScan']             = SCons.Defaults.CScan
+    globals['Default']           = Default
+    globals['Dir']               = SCons.Node.FS.default_fs.Dir
+    globals['Environment']       = SCons.Environment.Environment
+    globals['Export']            = Export
+    globals['File']              = SCons.Node.FS.default_fs.File
+    globals['GetBuildPath']      = GetBuildPath
+    globals['Help']              = Help
+    globals['Import']            = Import
+    globals['Library']           = SCons.Defaults.Library
+    globals['Object']            = SCons.Defaults.Object
+    globals['Program']           = SCons.Defaults.Program
+    globals['Return']            = Return
+    globals['Scanner']           = SCons.Scanner.Base
+    globals['SConscript']        = SConscript
     globals['SetCommandHandler'] = SCons.Action.SetCommandHandler
     return globals
index 496624d68d5a4fab2b19909c8a2c44edeaad506a..3e373ae68e61ef417b68f8651cd643dd9e00d24e 100644 (file)
@@ -63,6 +63,8 @@ subdir = Dir('subdir')
 script = File('SConscript', subdir)
 foo = SConscript(script)
 assert foo == "subdir/SConscript foo"
+
+SConscript('SConscript5')
 """)
 
 test.write('SConscript', """
@@ -138,6 +140,15 @@ foo = 'subdir/SConscript foo'
 Return('foo')
 """)
 
+
+test.write('SConscript5', """
+B = Builder(name = 'B', action = 'B')
+def scan():
+    pass
+S = Scanner(name = 'S', function = scan)
+A = Action("A")
+""")
+
 wpath = test.workpath()
 
 test.run(stdout = "SConstruct %s\nSConscript %s\n" % (wpath, wpath))