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

Unified Diff: build/android/gyp/proguard.py

Issue 23213002: Add support for proguard preprocessing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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
« no previous file with comments | « no previous file | build/java.gypi » ('j') | build/java.gypi » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/proguard.py
diff --git a/build/android/gyp/proguard.py b/build/android/gyp/proguard.py
new file mode 100644
index 0000000000000000000000000000000000000000..9b345e3bb27f34a3a6014a891c2ccefd8f8fb81f
--- /dev/null
+++ b/build/android/gyp/proguard.py
@@ -0,0 +1,50 @@
+#!/usr/bin/env python
+#
+# Copyright 2013 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
+
+from util import build_utils
+
+
+def DoProguard(options):
+ injars = options.input_path
+ outjars = options.output_path
+ classpath = build_utils.ParseGypList(options.classpath)
+ classpath = list(set(classpath))
+ libraryjars = ':'.join(classpath)
+ # proguard does its own dependency checking, avoid that by deleting the output
nyquist 2013/08/14 22:19:10 Nit: Missing dot at end of comment.
nyquist 2013/08/14 23:24:12 Done.
+ if os.path.exists(options.output_path):
+ os.remove(options.output_path)
+ proguard_cmd = [options.proguard_path, '-injars', injars, '-outjars', outjars, '-libraryjars', libraryjars, '@' + options.proguard_config]
nyquist 2013/08/14 22:19:10 Line too long.
nyquist 2013/08/14 23:24:12 Done.
+ build_utils.CheckCallDie(proguard_cmd)
+
+
+def main(argv):
+ parser = optparse.OptionParser()
+ parser.add_option('--proguard-path')
nyquist 2013/08/14 22:19:10 Add a help description to these?
nyquist 2013/08/14 23:24:12 Done.
+ parser.add_option('--input-path')
+ parser.add_option('--output-path')
+ parser.add_option('--proguard-config')
nyquist 2013/08/14 22:19:10 --proguard-config-file ?
nyquist 2013/08/14 23:24:12 Nope.
+ parser.add_option('--classpath')
+ parser.add_option('--stamp', help='Path to touch on success.')
+
+ # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
+ parser.add_option('--ignore', help='Ignored.')
+
+ options, _ = parser.parse_args()
+
+ DoProguard(options)
+
+ if options.stamp:
+ build_utils.Touch(options.stamp)
+
+
+if __name__ == '__main__':
+ sys.exit(main(sys.argv))
+
« no previous file with comments | « no previous file | build/java.gypi » ('j') | build/java.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698