OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
2 # | |
3 # Copyright 2016 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 optparse | |
8 import sys | |
9 | |
10 # Combines files in |input_files| as one proguard file and write that to | |
11 # |output_file| | |
12 def GenerateProguardFile(output_file, input_files): | |
13 try: | |
14 with open(output_file, "wb") as target: | |
15 for input_file in input_files: | |
16 f = open(input_file, "rb") | |
17 for line in f: | |
18 target.write(line) | |
pauljensen
2016/08/17 11:04:46
Any reason we don't use "cat" instead of this pyth
xunjieli
2016/08/17 12:50:31
Python scripts work across platforms. We can certa
pauljensen
2016/08/17 13:04:07
"cat" should work on any platform we build for And
xunjieli
2016/08/17 17:11:44
Thanks for the comments! I asked on Chromium-dev (
pauljensen
2016/08/18 15:46:09
I understand the GN folks' motivations for not usi
xunjieli
2016/09/07 15:33:24
Acknowledged.
| |
19 except IOError: | |
20 raise Exception("Proguard file generation failed") | |
21 | |
22 | |
23 def main(): | |
24 parser = optparse.OptionParser() | |
25 parser.add_option('--output-file', | |
26 help='Output file for the generated proguard file') | |
27 | |
28 options, input_files = parser.parse_args() | |
29 GenerateProguardFile(options.output_file, input_files) | |
30 | |
31 | |
32 if __name__ == '__main__': | |
33 sys.exit(main()) | |
OLD | NEW |