| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # This a simple script to make building/testing Mojo components easier. | 6 # This a simple script to make building/testing Mojo components easier. |
| 7 | 7 |
| 8 import argparse | 8 import argparse |
| 9 from copy import deepcopy | 9 from copy import deepcopy |
| 10 import os | 10 import os |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 paths = Paths(config) | 71 paths = Paths(config) |
| 72 return paths.SrcRelPath(paths.build_dir) | 72 return paths.SrcRelPath(paths.build_dir) |
| 73 | 73 |
| 74 | 74 |
| 75 def sync(config): | 75 def sync(config): |
| 76 # pylint: disable=W0613 | 76 # pylint: disable=W0613 |
| 77 return subprocess.call(['gclient', 'sync']) | 77 return subprocess.call(['gclient', 'sync']) |
| 78 | 78 |
| 79 | 79 |
| 80 def gn(config): | 80 def gn(config): |
| 81 command = ['gn', 'gen'] | 81 command = ['gn', 'gen', '--check'] |
| 82 | 82 |
| 83 gn_args = [] | 83 gn_args = [] |
| 84 gn_args.append('is_debug=' + ('true' if config.is_debug else 'false')) | 84 gn_args.append('is_debug=' + ('true' if config.is_debug else 'false')) |
| 85 gn_args.append('is_asan=' + ('true' if config.sanitizer == | 85 gn_args.append('is_asan=' + ('true' if config.sanitizer == |
| 86 Config.SANITIZER_ASAN else 'false')) | 86 Config.SANITIZER_ASAN else 'false')) |
| 87 if config.is_clang is not None: | 87 if config.is_clang is not None: |
| 88 gn_args.append('is_clang=' + ('true' if config.is_clang else 'false')) | 88 gn_args.append('is_clang=' + ('true' if config.is_clang else 'false')) |
| 89 else: | 89 else: |
| 90 gn_args.append('is_clang=' + ('true' if config.target_os not in | 90 gn_args.append('is_clang=' + ('true' if config.target_os not in |
| 91 (Config.OS_ANDROID, Config.OS_WINDOWS) | 91 (Config.OS_ANDROID, Config.OS_WINDOWS) |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 help='Run Dart unit tests (does not build).') | 264 help='Run Dart unit tests (does not build).') |
| 265 darttest_parser.set_defaults(func=darttest) | 265 darttest_parser.set_defaults(func=darttest) |
| 266 | 266 |
| 267 args = parser.parse_args() | 267 args = parser.parse_args() |
| 268 config = _args_to_config(args) | 268 config = _args_to_config(args) |
| 269 return args.func(config) | 269 return args.func(config) |
| 270 | 270 |
| 271 | 271 |
| 272 if __name__ == '__main__': | 272 if __name__ == '__main__': |
| 273 sys.exit(main()) | 273 sys.exit(main()) |
| OLD | NEW |