Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 | 2 |
| 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 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 |
| 11 import os | 11 import os |
| 12 import shlex | 12 import shlex |
| 13 import subprocess | 13 import subprocess |
| 14 import sys | 14 import sys |
| 15 | 15 |
| 16 script_dir = os.path.dirname(__file__) | 16 script_dir = os.path.realpath(os.path.dirname(__file__)) |
|
M-A Ruel
2012/07/09 19:32:14
The correct way of doing it is:
script_dir = os.pa
| |
| 17 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) | 17 chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) |
| 18 | 18 |
| 19 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) | 19 sys.path.insert(0, os.path.join(chrome_src, 'tools', 'gyp', 'pylib')) |
| 20 import gyp | 20 import gyp |
| 21 | 21 |
| 22 # Add paths so that pymod_do_main(...) can import files. | 22 # Add paths so that pymod_do_main(...) can import files. |
| 23 sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) | 23 sys.path.insert(1, os.path.join(chrome_src, 'tools', 'grit')) |
| 24 sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build')) | 24 sys.path.insert(1, os.path.join(chrome_src, 'chrome', 'tools', 'build')) |
| 25 sys.path.insert(1, os.path.join(chrome_src, 'native_client', 'build')) | 25 sys.path.insert(1, os.path.join(chrome_src, 'native_client', 'build')) |
| 26 | 26 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 164 # to enfore syntax checking. | 164 # to enfore syntax checking. |
| 165 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') | 165 syntax_check = os.environ.get('CHROMIUM_GYP_SYNTAX_CHECK') |
| 166 if syntax_check and int(syntax_check): | 166 if syntax_check and int(syntax_check): |
| 167 args.append('--check') | 167 args.append('--check') |
| 168 | 168 |
| 169 print 'Updating projects from gyp files...' | 169 print 'Updating projects from gyp files...' |
| 170 sys.stdout.flush() | 170 sys.stdout.flush() |
| 171 | 171 |
| 172 # Off we go... | 172 # Off we go... |
| 173 sys.exit(gyp.main(args)) | 173 sys.exit(gyp.main(args)) |
| OLD | NEW |