diff options
author | mef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-27 16:47:46 +0000 |
---|---|---|
committer | mef@chromium.org <mef@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-27 16:47:46 +0000 |
commit | 89ad19365a5fb3899e2749ca646099d76f7446ad (patch) | |
tree | 6385cb0d87f137741e872d90c37fb03467dc9786 /components/cronet | |
parent | d0d8abdc21492723e14edaed502397475254c128 (diff) | |
download | chromium_src-89ad19365a5fb3899e2749ca646099d76f7446ad.zip chromium_src-89ad19365a5fb3899e2749ca646099d76f7446ad.tar.gz chromium_src-89ad19365a5fb3899e2749ca646099d76f7446ad.tar.bz2 |
Combine base_java.jar, net_java.jar and url_java.jar into cronet.jar
BUG=354143
Review URL: https://codereview.chromium.org/293003010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/cronet')
-rwxr-xr-x | components/cronet/tools/extract_from_jars.py | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/components/cronet/tools/extract_from_jars.py b/components/cronet/tools/extract_from_jars.py new file mode 100755 index 0000000..d72d46c --- /dev/null +++ b/components/cronet/tools/extract_from_jars.py @@ -0,0 +1,48 @@ +#!/usr/bin/env python +# +# Copyright 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import fnmatch +import optparse +import os +import sys + +REPOSITORY_ROOT = os.path.abspath(os.path.join( + os.path.dirname(__file__), '..', '..', '..')) + +sys.path.append(os.path.join(REPOSITORY_ROOT, 'build/android/gyp/util')) +import build_utils + + +def ExtractJars(options): + # The paths of the files in the jar will be the same as they are passed in to + # the command. Because of this, the command should be run in + # options.classes_dir so the .class file paths in the jar are correct. + jar_cwd = options.classes_dir + build_utils.DeleteDirectory(jar_cwd) + build_utils.MakeDirectory(jar_cwd) + for jar in build_utils.ParseGypList(options.jars): + jar_path = os.path.abspath(jar) + jar_cmd = ['jar', 'xf', jar_path] + build_utils.CheckOutput(jar_cmd, cwd=jar_cwd) + + +def main(): + parser = optparse.OptionParser() + parser.add_option('--classes-dir', help='Directory to extract .class files.') + parser.add_option('--jars', help='Paths to jars to extract.') + parser.add_option('--stamp', help='Path to touch on success.') + + options, _ = parser.parse_args() + + ExtractJars(options) + + if options.stamp: + build_utils.Touch(options.stamp) + + +if __name__ == '__main__': + sys.exit(main()) + |