OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import os | 8 import os |
9 import sys | 9 import sys |
10 | 10 |
11 import buildbot_common | 11 import buildbot_common |
12 import build_utils | 12 import build_utils |
13 | 13 |
14 GS_MANIFEST_PATH = 'gs://nativeclient-mirror/nacl/nacl_sdk/' | 14 GS_MANIFEST_PATH = 'gs://nativeclient-mirror/nacl/nacl_sdk/' |
15 SDK_MANIFEST = 'naclsdk_manifest2.json' | 15 SDK_MANIFEST = 'naclsdk_manifest2.json' |
16 MONO_MANIFEST = 'naclmono_manifest.json' | 16 MONO_MANIFEST = 'naclmono_manifest.json' |
17 | 17 |
18 def build_and_upload_mono(sdk_revision, pepper_revision, sdk_url, upload_path, a
rgs): | 18 def build_and_upload_mono(sdk_revision, pepper_revision, sdk_url, |
| 19 upload_path, args): |
19 install_dir = 'naclmono' | 20 install_dir = 'naclmono' |
20 buildbot_common.RemoveDir(install_dir) | 21 buildbot_common.RemoveDir(install_dir) |
21 | 22 |
22 revision_opt = ['--sdk-revision', sdk_revision] if sdk_revision else [] | 23 revision_opt = ['--sdk-revision', sdk_revision] if sdk_revision else [] |
23 url_opt = ['--sdk-url', sdk_url] if sdk_url else [] | 24 url_opt = ['--sdk-url', sdk_url] if sdk_url else [] |
24 | 25 |
25 buildbot_common.Run([sys.executable, 'nacl-mono-builder.py', | 26 buildbot_common.Run([sys.executable, 'nacl-mono-builder.py', |
26 '--arch', 'x86-32', '--install-dir', install_dir] + | 27 '--arch', 'x86-32', '--install-dir', install_dir] + |
27 revision_opt + url_opt + args) | 28 revision_opt + url_opt + args) |
28 buildbot_common.Run([sys.executable, 'nacl-mono-builder.py', | 29 buildbot_common.Run([sys.executable, 'nacl-mono-builder.py', |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 105 |
105 def update_mono_sdk_json(infos): | 106 def update_mono_sdk_json(infos): |
106 '''Update the naclmono manifest with the newly built packages''' | 107 '''Update the naclmono manifest with the newly built packages''' |
107 if len(infos) == 0: | 108 if len(infos) == 0: |
108 return | 109 return |
109 | 110 |
110 manifest_file = open(MONO_MANIFEST, 'r') | 111 manifest_file = open(MONO_MANIFEST, 'r') |
111 mono_manifest = json.loads(manifest_file.read()) | 112 mono_manifest = json.loads(manifest_file.read()) |
112 manifest_file.close() | 113 manifest_file.close() |
113 | 114 |
114 newbundles = {} | |
115 for info in infos: | 115 for info in infos: |
116 bundle = {} | 116 bundle = {} |
117 bundle['name'] = info['naclmono_name'] | 117 bundle['name'] = info['naclmono_name'] |
118 bundle['description'] = 'Mono for Native Client' | 118 bundle['description'] = 'Mono for Native Client' |
119 bundle['stability'] = info['stability'] | 119 bundle['stability'] = info['stability'] |
120 bundle['recommended'] = 'no' | 120 bundle['recommended'] = 'no' |
121 bundle['version'] = 'experimental' | 121 bundle['version'] = 'experimental' |
122 archive = {} | 122 archive = {} |
123 sha1_hash = hashlib.sha1() | 123 sha1_hash = hashlib.sha1() |
124 f = open(info['naclmono_name'] + '.bz2', 'rb') | 124 f = open(info['naclmono_name'] + '.bz2', 'rb') |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 # This will put the file in naclmono_19/1/naclmono_19.bz2 for example. | 174 # This will put the file in naclmono_19/1/naclmono_19.bz2 for example. |
175 upload_path = info['naclmono_name'] + '/' + info['naclmono_rev'] | 175 upload_path = info['naclmono_name'] + '/' + info['naclmono_rev'] |
176 build_and_upload_mono(None, info['pepper_revision'], info['sdk_url'], | 176 build_and_upload_mono(None, info['pepper_revision'], info['sdk_url'], |
177 upload_path, args) | 177 upload_path, args) |
178 update_mono_sdk_json(infos) | 178 update_mono_sdk_json(infos) |
179 | 179 |
180 | 180 |
181 | 181 |
182 if __name__ == '__main__': | 182 if __name__ == '__main__': |
183 sys.exit(main(sys.argv)) | 183 sys.exit(main(sys.argv)) |
OLD | NEW |