OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Process Android resources to generate R.java, and prepare for packaging. | 7 """Process Android resources to generate R.java, and prepare for packaging. |
8 | 8 |
9 This will crunch images and generate v14 compatible resources | 9 This will crunch images and generate v14 compatible resources |
10 (see generate_v14_compatible_resources.py). | 10 (see generate_v14_compatible_resources.py). |
11 """ | 11 """ |
12 | 12 |
13 import codecs | 13 import codecs |
14 import optparse | 14 import optparse |
15 import os | 15 import os |
16 import re | 16 import re |
17 import shutil | 17 import shutil |
18 import sys | 18 import sys |
19 import zipfile | 19 import zipfile |
20 | 20 |
21 import generate_v14_compatible_resources | 21 import generate_v14_compatible_resources |
22 | 22 |
23 from util import build_utils | 23 from util import build_utils |
24 | 24 |
25 # Import jinja2 from third_party/jinja2 | 25 # Import jinja2 from third_party/jinja2 |
26 sys.path.append(os.path.join(os.path.dirname(__file__), '../../../third_party')) | 26 sys.path.insert(1, |
| 27 os.path.join(os.path.dirname(__file__), '../../../third_party')) |
27 from jinja2 import Template # pylint: disable=F0401 | 28 from jinja2 import Template # pylint: disable=F0401 |
28 | 29 |
29 | 30 |
30 def ParseArgs(args): | 31 def ParseArgs(args): |
31 """Parses command line options. | 32 """Parses command line options. |
32 | 33 |
33 Returns: | 34 Returns: |
34 An options object as from optparse.OptionsParser.parse_args() | 35 An options object as from optparse.OptionsParser.parse_args() |
35 """ | 36 """ |
36 parser = optparse.OptionParser() | 37 parser = optparse.OptionParser() |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 if options.depfile: | 413 if options.depfile: |
413 input_files += build_utils.GetPythonDependencies() | 414 input_files += build_utils.GetPythonDependencies() |
414 build_utils.WriteDepfile(options.depfile, input_files) | 415 build_utils.WriteDepfile(options.depfile, input_files) |
415 | 416 |
416 if options.stamp: | 417 if options.stamp: |
417 build_utils.Touch(options.stamp) | 418 build_utils.Touch(options.stamp) |
418 | 419 |
419 | 420 |
420 if __name__ == '__main__': | 421 if __name__ == '__main__': |
421 main() | 422 main() |
OLD | NEW |