Commit 98c11f13 authored by Shik Chen's avatar Shik Chen Committed by Commit Bot

CCA: Remove .crx packing utility

Since we migrated CCA to SWA, there is no .crx bundle anymore.

Bug: b:172341870
Test: CQ
Change-Id: I4fe3cee4ed969e9047d2b432e0d65797d2761e91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2525960
Commit-Queue: Shik Chen <shik@chromium.org>
Commit-Queue: Wei Lee <wtlee@chromium.org>
Auto-Submit: Shik Chen <shik@chromium.org>
Reviewed-by: default avatarWei Lee <wtlee@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825277}
parent da5cda71
...@@ -17,9 +17,6 @@ $ ./cca deploy <device> ...@@ -17,9 +17,6 @@ $ ./cca deploy <device>
# Run CCA Tast tests on <device> # Run CCA Tast tests on <device>
$ ./cca test <device> [patterns...] $ ./cca test <device> [patterns...]
# Pack CCA into a distributable .crx.
$ ./cca pack
``` ```
For more details, please check the usage of individual commands with the For more details, please check the usage of individual commands with the
......
...@@ -47,8 +47,7 @@ def build_locale_strings(): ...@@ -47,8 +47,7 @@ def build_locale_strings():
def build_mojom_bindings(mojom_bindings): def build_mojom_bindings(mojom_bindings):
pylib = os.path.join(get_chromium_root(), pylib = os.path.join(get_chromium_root(), 'mojo/public/tools/mojom')
'mojo/public/tools/mojom')
sys.path.insert(0, pylib) sys.path.insert(0, pylib)
# pylint: disable=import-error,import-outside-toplevel # pylint: disable=import-error,import-outside-toplevel
from mojom.parse.parser import Parse from mojom.parse.parser import Parse
...@@ -91,9 +90,8 @@ def build_mojom_bindings(mojom_bindings): ...@@ -91,9 +90,8 @@ def build_mojom_bindings(mojom_bindings):
] ]
run(precompile_cmd) run(precompile_cmd)
parser = os.path.join( parser = os.path.join(get_chromium_root(),
get_chromium_root(), 'mojo/public/tools/mojom/mojom_parser.py')
'mojo/public/tools/mojom/mojom_parser.py')
parse_cmd = [ parse_cmd = [
parser, parser,
...@@ -271,36 +269,6 @@ def test(args): ...@@ -271,36 +269,6 @@ def test(args):
run(cmd) run(cmd)
def pack(args):
assert os.path.exists(args.key), f'There is no key at {args.key}'
pubkey = None
if shutil.which('openssl'):
openssl_cmd = ['openssl', 'rsa', '-in', args.key, '-pubout']
openssl_output = subprocess.check_output(openssl_cmd,
stderr=subprocess.DEVNULL,
text=True)
pubkey = ''.join(openssl_output.splitlines()[1:-1])
build_cca(overlay='dev', key=pubkey)
if os.path.exists('build/camera.crx'):
os.remove('build/camera.crx')
pack_cmd = [
'google-chrome',
'--disable-gpu', # suppress an error about sandbox on gpu process
'--pack-extension=build/camera',
shlex.quote(f'--pack-extension-key={args.key}'),
]
if shutil.which('xvfb-run'):
# Run it in a virtual X server environment
pack_cmd.insert(0, 'xvfb-run')
run(pack_cmd)
assert os.path.exists('build/camera.crx')
shutil.move('build/camera.crx', args.output)
# TODO(shik): Add an option to deploy/install the packed crx on device
def lint(args): def lint(args):
root = get_chromium_root() root = get_chromium_root()
node = os.path.join(root, 'third_party/node/linux/node-linux-x64/bin/node') node = os.path.join(root, 'third_party/node/linux/node-linux-x64/bin/node')
...@@ -341,19 +309,6 @@ def parse_args(args): ...@@ -341,19 +309,6 @@ def parse_args(args):
help='test patterns. (default: camera.CCAUI*)') help='test patterns. (default: camera.CCAUI*)')
test_parser.set_defaults(func=test) test_parser.set_defaults(func=test)
pack_parser = subparsers.add_parser('pack',
help='pack crx',
description='Pack CCA into a crx.')
pack_parser.add_argument('-o',
'--output',
help='output file (default: build/camera.crx)',
default='build/camera.crx')
pack_parser.add_argument('-k',
'--key',
help='private key file (default: camera.pem)',
default='camera.pem')
pack_parser.set_defaults(func=pack)
lint_parser = subparsers.add_parser('lint', lint_parser = subparsers.add_parser('lint',
help='check code', help='check code',
description='Check coding styles.') description='Check coding styles.')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment