Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
5 import base64 | 5 import base64 |
6 import hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import mimetypes | 8 import mimetypes |
9 import os | 9 import os |
10 import zipfile | 10 import zipfile |
11 | 11 |
12 import packager | 12 import packager |
13 import packagerChrome | 13 import packagerChrome |
14 from packager import (readMetadata, getDefaultFileName) | |
Wladimir Palant
2016/10/22 20:12:51
Why did you add this? I don't see these functions
kzar
2016/10/25 07:50:51
This change was required for `./build.py -t edge r
Wladimir Palant
2016/10/25 10:21:37
1) Please add a comment explaining that releaseAut
kzar
2016/10/25 10:36:37
Done.
| |
15 | 14 |
16 # Files and directories expected inside of the .APPX archive. | 15 # Files and directories expected inside of the .APPX archive. |
17 MANIFEST = 'AppxManifest.xml' | 16 MANIFEST = 'AppxManifest.xml' |
18 CONTENT_TYPES = '[Content_Types].xml' | 17 CONTENT_TYPES = '[Content_Types].xml' |
19 BLOCKMAP = 'AppxBlockMap.xml' | 18 BLOCKMAP = 'AppxBlockMap.xml' |
20 EXTENSION_DIR = 'Extension' | 19 EXTENSION_DIR = 'Extension' |
21 ASSETS_DIR = 'Assets' | 20 ASSETS_DIR = 'Assets' |
22 | 21 |
23 # Size of uncompressed block in the APPX block map. | 22 # Size of uncompressed block in the APPX block map. |
24 BLOCKSIZE = 64 * 1024 | 23 BLOCKSIZE = 64 * 1024 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 if metadata.has_section('appx_assets'): | 174 if metadata.has_section('appx_assets'): |
176 for name, path in metadata.items('appx_assets'): | 175 for name, path in metadata.items('appx_assets'): |
177 path = os.path.join(baseDir, path) | 176 path = os.path.join(baseDir, path) |
178 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) | 177 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) |
179 | 178 |
180 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild) | 179 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild) |
181 files[BLOCKMAP] = create_appx_blockmap(files) | 180 files[BLOCKMAP] = create_appx_blockmap(files) |
182 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) | 181 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) |
183 | 182 |
184 files.zip(outfile, compression=zipfile.ZIP_STORED) | 183 files.zip(outfile, compression=zipfile.ZIP_STORED) |
LEFT | RIGHT |