OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # This script is wrapper for Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 file_contents = open(file_path).read() | 52 file_contents = open(file_path).read() |
53 try: | 53 try: |
54 file_data = eval(file_contents, {'__builtins__': None}, None) | 54 file_data = eval(file_contents, {'__builtins__': None}, None) |
55 except SyntaxError, e: | 55 except SyntaxError, e: |
56 e.filename = os.path.abspath(file_path) | 56 e.filename = os.path.abspath(file_path) |
57 raise | 57 raise |
58 supported_vars = ( 'CHROMIUM_GYP_FILE', | 58 supported_vars = ( 'CHROMIUM_GYP_FILE', |
59 'CHROMIUM_GYP_SYNTAX_CHECK', | 59 'CHROMIUM_GYP_SYNTAX_CHECK', |
60 'GYP_DEFINES', | 60 'GYP_DEFINES', |
61 'GYP_GENERATOR_FLAGS', | 61 'GYP_GENERATOR_FLAGS', |
62 'GYP_GENERATOR_OUTPUT', ) | 62 'GYP_GENERATOR_OUTPUT', |
| 63 'GYP_GENERATORS', ) |
63 for var in supported_vars: | 64 for var in supported_vars: |
64 val = file_data.get(var) | 65 val = file_data.get(var) |
65 if val: | 66 if val: |
66 if var in os.environ: | 67 if var in os.environ: |
67 print 'INFO: Environment value for "%s" overrides value in %s.' % ( | 68 print 'INFO: Environment value for "%s" overrides value in %s.' % ( |
68 var, os.path.abspath(file_path) | 69 var, os.path.abspath(file_path) |
69 ) | 70 ) |
70 else: | 71 else: |
71 os.environ[var] = val | 72 os.environ[var] = val |
72 | 73 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 # to enfore syntax checking. | 163 # to enfore syntax checking. |
163 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 164 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
164 if syntax_check and int(syntax_check): | 165 if syntax_check and int(syntax_check): |
165 args.append('--check') | 166 args.append('--check') |
166 | 167 |
167 print 'Updating projects from gyp files...' | 168 print 'Updating projects from gyp files...' |
168 sys.stdout.flush() | 169 sys.stdout.flush() |
169 | 170 |
170 # Off we go... | 171 # Off we go... |
171 sys.exit(gyp.main(args)) | 172 sys.exit(gyp.main(args)) |
OLD | NEW |