| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 import optparse | 7 import optparse |
| 8 import os | 8 import os |
| 9 import sys | 9 import sys |
| 10 | 10 |
| 11 from util import build_utils | 11 from util import build_utils |
| 12 from util import md5_check |
| 12 from util import proguard_util | 13 from util import proguard_util |
| 13 | 14 |
| 14 | 15 |
| 15 def _ParseOptions(args): | 16 def _ParseOptions(args): |
| 16 parser = optparse.OptionParser() | 17 parser = optparse.OptionParser() |
| 17 build_utils.AddDepfileOption(parser) | 18 build_utils.AddDepfileOption(parser) |
| 18 parser.add_option('--proguard-path', | 19 parser.add_option('--proguard-path', |
| 19 help='Path to the proguard executable.') | 20 help='Path to the proguard executable.') |
| 20 parser.add_option('--input-paths', | 21 parser.add_option('--input-paths', |
| 21 help='Paths to the .jar files proguard should run on.') | 22 help='Paths to the .jar files proguard should run on.') |
| (...skipping 30 matching lines...) Expand all Loading... |
| 52 if options.mapping: | 53 if options.mapping: |
| 53 proguard.mapping(options.mapping) | 54 proguard.mapping(options.mapping) |
| 54 | 55 |
| 55 if options.is_test: | 56 if options.is_test: |
| 56 proguard.is_test(True) | 57 proguard.is_test(True) |
| 57 | 58 |
| 58 classpath = list(set(options.classpath)) | 59 classpath = list(set(options.classpath)) |
| 59 proguard.libraryjars(classpath) | 60 proguard.libraryjars(classpath) |
| 60 | 61 |
| 61 input_paths = proguard.GetInputs() | 62 input_paths = proguard.GetInputs() |
| 63 python_deps = build_utils.GetPythonDependencies() |
| 62 | 64 |
| 63 build_utils.CallAndWriteDepfileIfStale( | 65 def OnStaleMd5(): |
| 64 proguard.CheckOutput, | 66 proguard.CheckOutput() |
| 65 options, | 67 |
| 68 if options.depfile: |
| 69 build_utils.WriteDepfile(options.depfile, python_deps + input_paths) |
| 70 if options.stamp: |
| 71 build_utils.Touch(options.stamp) |
| 72 |
| 73 md5_check.CallAndRecordIfStale( |
| 74 OnStaleMd5, |
| 75 record_path=options.output_path + '.proguard.md5.stamp', |
| 66 input_paths=input_paths, | 76 input_paths=input_paths, |
| 67 input_strings=proguard.build(), | 77 input_strings=proguard.build() + python_deps, |
| 68 output_paths=[options.output_path]) | 78 force=not os.path.exists(options.output_path)) |
| 69 | 79 |
| 70 | 80 |
| 71 if __name__ == '__main__': | 81 if __name__ == '__main__': |
| 72 sys.exit(main(sys.argv[1:])) | 82 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |