Skip to content

Commit

Permalink
Use the public SCons API to create the GRIT Builder and Action,
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sgk@google.com committed Nov 18, 2008
1 parent 075bc8c commit e187689
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions tools/grit/grit/scons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])

Expand Down

0 comments on commit e187689

Please sign in to comment.