diff options
author | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-18 20:24:44 +0000 |
---|---|---|
committer | sgk@google.com <sgk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-18 20:24:44 +0000 |
commit | e1876892f9fee355c69467599f573ad08f031863 (patch) | |
tree | e15494f1a1636d23ccb5f2c477be125c59f2cdcc /tools/grit | |
parent | 075bc8cbe5826e1f0034b2a97a7b7bdda2ce4515 (diff) | |
download | chromium_src-e1876892f9fee355c69467599f573ad08f031863.zip chromium_src-e1876892f9fee355c69467599f573ad08f031863.tar.gz chromium_src-e1876892f9fee355c69467599f573ad08f031863.tar.bz2 |
Use the public SCons API to create the GRIT Builder and Action,
not by reaching directly into the SCons internals.
Review URL: http://codereview.chromium.org/11242
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5629 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/grit')
-rw-r--r-- | tools/grit/grit/scons.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/tools/grit/grit/scons.py b/tools/grit/grit/scons.py index d0ac231..9481bc7 100644 --- a/tools/grit/grit/scons.py +++ b/tools/grit/grit/scons.py @@ -133,18 +133,15 @@ def _Scanner(file_node, env, path): # Function name is mandated by newer versions of SCons. def generate(env): - # Importing this module should be possible whenever this function is invoked - # since it should only be invoked by SCons. - import SCons.Builder - import SCons.Action - # The varlist parameter tells SCons that GRIT needs to be invoked again # if RCFLAGS has changed since last compilation. - action = SCons.Action.FunctionAction(_Builder, varlist=['RCFLAGS']) + + # TODO(gspencer): change to use the public SCons API Action() + # and Builder(), instead of reaching directly into internal APIs. + # Get this change folded back into the upstream grit tool. + action = env.Action(_Builder, varlist=['RCFLAGS']) - builder = SCons.Builder.Builder(action=action, - emitter=_Emitter, - src_suffix='.grd') + builder = env.Builder(action=action, emitter=_Emitter, src_suffix='.grd') scanner = env.Scanner(function=_Scanner, name='GRIT', skeys=['.grd']) |