| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 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 import argparse | 6 import argparse |
| 7 import glob | 7 import glob |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| 11 import tempfile | 11 import tempfile |
| 12 import time | 12 import time |
| 13 import zipfile | 13 import zipfile |
| 14 | 14 |
| 15 import mopy.gn as gn | 15 import mopy.gn as gn |
| 16 from mopy.config import Config | 16 from mopy.config import Config |
| 17 from mopy.paths import Paths | 17 from mopy.paths import Paths |
| 18 from mopy.version import Version | 18 from mopy.version import Version |
| 19 | 19 |
| 20 BLACKLISTED_APPS = [ | 20 BLACKLISTED_APPS = [ |
| 21 # The network service apps are not produced out of the Mojo repo, but may | 21 # The network service apps are not produced out of the Mojo repo, but may |
| 22 # be present in the build dir. | 22 # be present in the build dir. |
| 23 "network_service.mojo", | 23 "network_service.mojo", |
| 24 "network_service_apptests.mojo", | 24 "network_service_apptests.mojo", |
| 25 ] | 25 ] |
| 26 | 26 |
| 27 def target(config): | 27 def target(config): |
| 28 return config.target_os + "-" + config.target_arch | 28 return config.target_os + "-" + config.target_cpu |
| 29 | 29 |
| 30 def find_apps_to_upload(build_dir): | 30 def find_apps_to_upload(build_dir): |
| 31 apps = [] | 31 apps = [] |
| 32 for path in glob.glob(build_dir + "/*"): | 32 for path in glob.glob(build_dir + "/*"): |
| 33 if not os.path.isfile(path): | 33 if not os.path.isfile(path): |
| 34 continue | 34 continue |
| 35 _, ext = os.path.splitext(path) | 35 _, ext = os.path.splitext(path) |
| 36 if ext != '.mojo': | 36 if ext != '.mojo': |
| 37 continue | 37 continue |
| 38 if os.path.basename(path) in BLACKLISTED_APPS: | 38 if os.path.basename(path) in BLACKLISTED_APPS: |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 apps_to_upload = find_apps_to_upload( | 130 apps_to_upload = find_apps_to_upload( |
| 131 gn.BuildDirectoryForConfig(config, Paths(config).src_root)) | 131 gn.BuildDirectoryForConfig(config, Paths(config).src_root)) |
| 132 for app in apps_to_upload: | 132 for app in apps_to_upload: |
| 133 upload_app(app, config, args.dry_run) | 133 upload_app(app, config, args.dry_run) |
| 134 | 134 |
| 135 return 0 | 135 return 0 |
| 136 | 136 |
| 137 if __name__ == "__main__": | 137 if __name__ == "__main__": |
| 138 sys.exit(main()) | 138 sys.exit(main()) |
| OLD | NEW |