mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
[packager] Optimize archive accesses.
This commit is contained in:
parent
48a4d20592
commit
d0dbdf4e8b
7 changed files with 107 additions and 30 deletions
|
|
@ -23,6 +23,7 @@ from mozpack.copier import (
|
|||
Jarrer,
|
||||
)
|
||||
from mozpack.errors import errors
|
||||
from mozpack.mozjar import JAR_BROTLI
|
||||
from mozpack.unify import UnifiedBuildFinder
|
||||
import mozpack.path as mozpath
|
||||
import buildconfig
|
||||
|
|
@ -270,9 +271,9 @@ def main():
|
|||
help='Enable jar optimizations')
|
||||
parser.add_argument('--unify', default='',
|
||||
help='Base directory of another build to unify with')
|
||||
parser.add_argument('--disable-compression', action='store_false',
|
||||
dest='compress', default=True,
|
||||
help='Disable jar compression')
|
||||
parser.add_argument('--compress', choices=('none', 'deflate', 'brotli'),
|
||||
default='deflate',
|
||||
help='Use given jar compression (default: deflate)')
|
||||
parser.add_argument('manifest', default=None, nargs='?',
|
||||
help='Manifest file name')
|
||||
parser.add_argument('source', help='Source directory')
|
||||
|
|
@ -290,15 +291,21 @@ def main():
|
|||
for name, value in [split_define(d) for d in args.defines]:
|
||||
defines[name] = value
|
||||
|
||||
compress = {
|
||||
'none': False,
|
||||
'deflate': True,
|
||||
'brotli': JAR_BROTLI,
|
||||
}[args.compress]
|
||||
|
||||
copier = FileCopier()
|
||||
if args.format == 'flat':
|
||||
formatter = FlatFormatter(copier)
|
||||
elif args.format == 'jar':
|
||||
formatter = JarFormatter(copier, compress=args.compress, optimize=args.optimizejars)
|
||||
formatter = JarFormatter(copier, compress=compress, optimize=args.optimizejars)
|
||||
elif args.format == 'omni':
|
||||
formatter = OmniJarFormatter(copier,
|
||||
buildconfig.substs['OMNIJAR_NAME'],
|
||||
compress=args.compress,
|
||||
compress=compress,
|
||||
optimize=args.optimizejars,
|
||||
non_resources=args.non_resource)
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue