Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 # Invokes gperf for the GN build. The first argument is the path to gperf. | 5 # Invokes gperf for the GN build. |
| 6 # Usage: gperf.py [--developer_dir PATH_TO_XCODE] gperf ... | |
| 6 # TODO(brettw) this can be removed once the run_executable rules have been | 7 # TODO(brettw) this can be removed once the run_executable rules have been |
| 7 # checked in for the GN build. | 8 # checked in for the GN build. |
| 8 | 9 |
| 10 import os | |
| 9 import subprocess | 11 import subprocess |
| 10 import sys | 12 import sys |
| 11 | 13 |
| 12 subprocess.check_call(sys.argv[1:]) | 14 |
| 15 def main(): | |
| 16 argument_start = 1 | |
| 17 if sys.argv[1] == "--developer_dir": | |
|
Nico
2016/10/08 19:03:37
i'd use argparse. it's maybe two lines more code a
erikchen
2016/10/10 19:20:57
Done.
| |
| 18 os.environ['DEVELOPER_DIR'] = sys.argv[2] | |
| 19 argument_start = 3 | |
| 20 | |
| 21 subprocess.check_call(sys.argv[argument_start:]) | |
| 22 | |
| 23 if __name__ == '__main__': | |
| 24 main() | |
| OLD | NEW |