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 import os | 5 import os |
6 | 6 |
7 from .config import Config | 7 from .config import Config |
8 from .gn import BuildDirectoryForConfig | 8 from .gn import BuildDirectoryForConfig |
9 | 9 |
10 class Paths(object): | 10 class Paths(object): |
(...skipping 18 matching lines...) Expand all Loading... |
29 if self.build_dir is not None: | 29 if self.build_dir is not None: |
30 self.mojo_shell_path = os.path.join(self.build_dir, "mojo_runner") | 30 self.mojo_shell_path = os.path.join(self.build_dir, "mojo_runner") |
31 # TODO(vtl): Use the host OS here, since |config| may not be available. | 31 # TODO(vtl): Use the host OS here, since |config| may not be available. |
32 # In any case, if the target is Windows, but the host isn't, using | 32 # In any case, if the target is Windows, but the host isn't, using |
33 # |os.path| isn't correct.... | 33 # |os.path| isn't correct.... |
34 if Config.GetHostOS() == Config.OS_WINDOWS: | 34 if Config.GetHostOS() == Config.OS_WINDOWS: |
35 self.mojo_shell_path += ".exe" | 35 self.mojo_shell_path += ".exe" |
36 if config and config.target_os == Config.OS_ANDROID: | 36 if config and config.target_os == Config.OS_ANDROID: |
37 self.target_mojo_shell_path = os.path.join(self.build_dir, | 37 self.target_mojo_shell_path = os.path.join(self.build_dir, |
38 "apks", | 38 "apks", |
39 "MojoShell.apk") | 39 "MojoRunner.apk") |
40 else: | 40 else: |
41 self.target_mojo_shell_path = self.mojo_shell_path | 41 self.target_mojo_shell_path = self.mojo_shell_path |
42 else: | 42 else: |
43 self.mojo_shell_path = None | 43 self.mojo_shell_path = None |
44 self.target_mojo_shell_path = None | 44 self.target_mojo_shell_path = None |
45 | 45 |
46 def RelPath(self, path): | 46 def RelPath(self, path): |
47 """Returns the given path, relative to the current directory.""" | 47 """Returns the given path, relative to the current directory.""" |
48 return os.path.relpath(path) | 48 return os.path.relpath(path) |
49 | 49 |
(...skipping 10 matching lines...) Expand all Loading... |
60 return os.path.join(self.build_dir, name + '.mojo') | 60 return os.path.join(self.build_dir, name + '.mojo') |
61 return name + '.mojo' | 61 return name + '.mojo' |
62 | 62 |
63 @staticmethod | 63 @staticmethod |
64 def IsValidAppUrl(url): | 64 def IsValidAppUrl(url): |
65 """Returns False if url is malformed, True otherwise.""" | 65 """Returns False if url is malformed, True otherwise.""" |
66 try: | 66 try: |
67 return len(url.split(':')) == 2 | 67 return len(url.split(':')) == 2 |
68 except ValueError: | 68 except ValueError: |
69 return False | 69 return False |
OLD | NEW |