Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(218)

Unified Diff: components/cronet/tools/extract_from_jars.py

Issue 293003010: Combine base_java.jar, net_java.jar and url_java.jar into cronet.jar (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« components/cronet.gypi ('K') | « components/cronet.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/cronet/tools/extract_from_jars.py
diff --git a/components/cronet/tools/extract_from_jars.py b/components/cronet/tools/extract_from_jars.py
new file mode 100755
index 0000000000000000000000000000000000000000..dc128e27d3ffc85573ac53907d81afa5189e391c
--- /dev/null
+++ b/components/cronet/tools/extract_from_jars.py
@@ -0,0 +1,48 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 The Chromium Authors. All rights reserved.
Paweł Hajdan Jr. 2014/05/22 13:34:42 nit: 2014
mef 2014/05/22 22:28:09 Done.
+# 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);
Paweł Hajdan Jr. 2014/05/22 13:34:42 nit: Remove ; from the end, too much c++ ;-)
mef 2014/05/22 22:28:09 Done.
+ 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())
+
« components/cronet.gypi ('K') | « components/cronet.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698