| 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 from skypy.skyserver import SkyServer | 6 from skypy.skyserver import SkyServer |
| 7 import argparse | 7 import argparse |
| 8 import json | 8 import json |
| 9 import logging | 9 import logging |
| 10 import os | 10 import os |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 GDB_PORT = 8888 | 30 GDB_PORT = 8888 |
| 31 SKY_SERVER_PORT = 9999 | 31 SKY_SERVER_PORT = 9999 |
| 32 DEFAULT_URL = "https://raw.githubusercontent.com/domokit/mojo/master/sky/example
s/home.sky" | 32 DEFAULT_URL = "https://raw.githubusercontent.com/domokit/mojo/master/sky/example
s/home.sky" |
| 33 | 33 |
| 34 ANDROID_PACKAGE = "org.chromium.mojo.shell" | 34 ANDROID_PACKAGE = "org.chromium.mojo.shell" |
| 35 ANDROID_ACTIVITY = "%s/.MojoShellActivity" % ANDROID_PACKAGE | 35 ANDROID_ACTIVITY = "%s/.MojoShellActivity" % ANDROID_PACKAGE |
| 36 ANDROID_APK_NAME = 'MojoShell.apk' | 36 ANDROID_APK_NAME = 'MojoShell.apk' |
| 37 | 37 |
| 38 PID_FILE_PATH = "/tmp/skydb.pids" | 38 PID_FILE_PATH = "/tmp/skydb.pids" |
| 39 CACHE_LINKS_PATH = '/tmp/mojo_cache_links' | 39 CACHE_LINKS_PATH = '/tmp/mojo_cache_links' |
| 40 # TODO(iansf): Fix undefined behavior when you have more than one device attache
d. | |
| 41 SYSTEM_LIBS_ROOT_PATH = '/tmp/device_libs/%s' % (subprocess.check_output(['adb',
'get-serialno']).strip()) | |
| 42 | 40 |
| 43 SRC_ROOT = skypy.paths.Paths('ignored').src_root | 41 SRC_ROOT = skypy.paths.Paths('ignored').src_root |
| 44 ADB_PATH = os.path.join(SRC_ROOT, | 42 ADB_PATH = os.path.join(SRC_ROOT, |
| 45 'third_party/android_tools/sdk/platform-tools/adb') | 43 'third_party/android_tools/sdk/platform-tools/adb') |
| 46 | 44 |
| 45 # TODO(iansf): Fix undefined behavior when you have more than one device attache
d. |
| 46 SYSTEM_LIBS_ROOT_PATH = '/tmp/device_libs/%s' % (subprocess.check_output([ADB_PA
TH, 'get-serialno']).strip()) |
| 47 |
| 47 | 48 |
| 48 # FIXME: Move this into mopy.config | 49 # FIXME: Move this into mopy.config |
| 49 def gn_args_from_build_dir(build_dir): | 50 def gn_args_from_build_dir(build_dir): |
| 50 gn_cmd = [ | 51 gn_cmd = [ |
| 51 'gn', 'args', | 52 'gn', 'args', |
| 52 build_dir, | 53 build_dir, |
| 53 '--list', '--short' | 54 '--list', '--short' |
| 54 ] | 55 ] |
| 55 config = {} | 56 config = {} |
| 56 for line in subprocess.check_output(gn_cmd).strip().split('\n'): | 57 for line in subprocess.check_output(gn_cmd).strip().split('\n'): |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 637 load_parser.set_defaults(func=self.load_command) | 638 load_parser.set_defaults(func=self.load_command) |
| 638 | 639 |
| 639 args = parser.parse_args() | 640 args = parser.parse_args() |
| 640 args.func(args) | 641 args.func(args) |
| 641 | 642 |
| 642 self._write_pid_file(PID_FILE_PATH, self.pids) | 643 self._write_pid_file(PID_FILE_PATH, self.pids) |
| 643 | 644 |
| 644 | 645 |
| 645 if __name__ == '__main__': | 646 if __name__ == '__main__': |
| 646 SkyDebugger().main() | 647 SkyDebugger().main() |
| OLD | NEW |