Chromium Code Reviews| 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 with open(input_file, "rb") as current: | |
| 17 target.write(current.read()) | |
|
mef
2016/08/10 01:25:35
what would happen if there is no newline at the en
xunjieli
2016/08/11 21:05:53
Done. You are right. That will be bad. I changed i
| |
| 18 except IOError: | |
| 19 raise Exception("Proguard file generation failed") | |
| 20 | |
| 21 | |
| 22 def main(): | |
| 23 parser = optparse.OptionParser() | |
| 24 parser.add_option('--output-file', | |
| 25 help='Output file for the generated proguard file') | |
| 26 | |
| 27 options, input_files = parser.parse_args() | |
| 28 GenerateProguardFile(options.output_file, input_files) | |
| 29 | |
| 30 | |
| 31 if __name__ == '__main__': | |
| 32 sys.exit(main()) | |
| OLD | NEW |