| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 """Helper for building and deploying Observatory""" | 5 """Helper for building and deploying Observatory""" |
| 6 | 6 |
| 7 import argparse | 7 import argparse |
| 8 import os | 8 import os |
| 9 import platform | 9 import platform |
| 10 import shutil | 10 import shutil |
| 11 import subprocess | 11 import subprocess |
| 12 import sys | 12 import sys |
| 13 import utils | 13 import utils |
| 14 | 14 |
| 15 SCRIPT_DIR = os.path.dirname(sys.argv[0]) | 15 SCRIPT_DIR = os.path.dirname(sys.argv[0]) |
| 16 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) | 16 DART_ROOT = os.path.realpath(os.path.join(SCRIPT_DIR, '..')) |
| 17 PUB_PATH = os.path.join(DART_ROOT, 'third_party', 'pkg', | 17 PUB_PATH = os.path.join(DART_ROOT, 'third_party', 'pkg', |
| 18 'pub', 'bin', 'pub.dart') | 18 'pub', 'bin', 'pub.dart') |
| 19 IGNORE_PATTERNS = shutil.ignore_patterns( | 19 IGNORE_PATTERNS = shutil.ignore_patterns( |
| 20 '*.map', | 20 '*.map', |
| 21 '*.concat.js', | 21 '*.concat.js', |
| 22 '*.scriptUrls', | 22 '*.scriptUrls', |
| 23 '*.precompiled.js', | 23 '*.precompiled.js', |
| 24 'main.*', | |
| 25 'unittest*', | 24 'unittest*', |
| 26 '*_buildLogs*', | 25 '*_buildLogs*', |
| 27 '*.log', | 26 '*.log', |
| 28 '*~') | 27 '*~') |
| 29 | 28 |
| 30 usage = """observatory_tool.py [options]""" | 29 usage = """observatory_tool.py [options]""" |
| 31 | 30 |
| 32 def CreateTimestampFile(options): | 31 def CreateTimestampFile(options): |
| 33 if options.stamp != '': | 32 if options.stamp != '': |
| 34 dir_name = os.path.dirname(options.stamp) | 33 dir_name = os.path.dirname(options.stamp) |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 # Pub must be run from the project's root directory. | 217 # Pub must be run from the project's root directory. |
| 219 ChangeDirectory(options.directory) | 218 ChangeDirectory(options.directory) |
| 220 result = ExecuteCommand(options, args) | 219 result = ExecuteCommand(options, args) |
| 221 if result == 0: | 220 if result == 0: |
| 222 CreateTimestampFile(options) | 221 CreateTimestampFile(options) |
| 223 return result | 222 return result |
| 224 | 223 |
| 225 | 224 |
| 226 if __name__ == '__main__': | 225 if __name__ == '__main__': |
| 227 sys.exit(main()); | 226 sys.exit(main()); |
| OLD | NEW |