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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | build/java.gypi » ('j') | build/java.gypi » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6
7 import fnmatch
8 import optparse
9 import os
10 import sys
11
12 from util import build_utils
13
14
15 def DoProguard(options):
16 injars = options.input_path
17 outjars = options.output_path
18 classpath = build_utils.ParseGypList(options.classpath)
19 classpath = list(set(classpath))
20 libraryjars = ':'.join(classpath)
21 # 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.
22 if os.path.exists(options.output_path):
23 os.remove(options.output_path)
24 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.
25 build_utils.CheckCallDie(proguard_cmd)
26
27
28 def main(argv):
29 parser = optparse.OptionParser()
30 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.
31 parser.add_option('--input-path')
32 parser.add_option('--output-path')
33 parser.add_option('--proguard-config')
nyquist 2013/08/14 22:19:10 --proguard-config-file ?
nyquist 2013/08/14 23:24:12 Nope.
34 parser.add_option('--classpath')
35 parser.add_option('--stamp', help='Path to touch on success.')
36
37 # TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
38 parser.add_option('--ignore', help='Ignored.')
39
40 options, _ = parser.parse_args()
41
42 DoProguard(options)
43
44 if options.stamp:
45 build_utils.Touch(options.stamp)
46
47
48 if __name__ == '__main__':
49 sys.exit(main(sys.argv))
50
OLDNEW
« 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