1 # Copyright (c) 2011 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
7 gypsh is a GYP shell. It's not really a generator per se. All it does is
8 fire up an interactive Python session with a few local variables set to the
9 variables passed to the generator. Like gypd, it's intended as a debugging
10 aid, to facilitate the exploration of .gyp structures after being processed
13 The expected usage is "gyp -f gypsh -D OS=desired_os".
21 # All of this stuff about generator variables was lovingly ripped from gypd.py.
22 # That module has a much better description of what's going on and why.
23 _generator_identity_variables = [
33 'SHARED_INTERMEDIATE_DIR',
36 generator_default_variables = {
39 for v in _generator_identity_variables:
40 generator_default_variables[v] = '<(%s)' % v
43 def GenerateOutput(target_list, target_dicts, data, params):
45 'target_list': target_list,
46 'target_dicts': target_dicts,
50 # Use a banner that looks like the stock Python one and like what
51 # code.interact uses by default, but tack on something to indicate what
52 # locals are available, and identify gypsh.
53 banner='Python %s on %s\nlocals.keys() = %s\ngypsh' % \
54 (sys.version, sys.platform, repr(sorted(locals.keys())))
56 code.interact(banner, local=locals)