| 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 """Instruments classes and jar files. | 7 """Instruments classes and jar files. |
| 8 | 8 |
| 9 This script corresponds to the 'emma_instr' action in the java build process. | 9 This script corresponds to the 'emma_instr' action in the java build process. |
| 10 Depending on whether emma_instrument is set, the 'emma_instr' action will either | 10 Depending on whether emma_instrument is set, the 'emma_instr' action will either |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 | 188 |
| 189 # Delete output_path first to avoid modifying input_path in the case where | 189 # Delete output_path first to avoid modifying input_path in the case where |
| 190 # input_path is a hardlink to output_path. http://crbug.com/571642 | 190 # input_path is a hardlink to output_path. http://crbug.com/571642 |
| 191 if os.path.exists(options.output_path): | 191 if os.path.exists(options.output_path): |
| 192 os.unlink(options.output_path) | 192 os.unlink(options.output_path) |
| 193 shutil.move(os.path.join(temp_jar_dir, jars[0]), options.output_path) | 193 shutil.move(os.path.join(temp_jar_dir, jars[0]), options.output_path) |
| 194 finally: | 194 finally: |
| 195 shutil.rmtree(temp_dir) | 195 shutil.rmtree(temp_dir) |
| 196 | 196 |
| 197 if options.source_dirs: | 197 if options.source_dirs: |
| 198 source_dirs = build_utils.ParseGypList(options.source_dirs) | 198 source_dirs = build_utils.ParseGnList(options.source_dirs) |
| 199 else: | 199 else: |
| 200 source_files = [] | 200 source_files = [] |
| 201 if options.source_files: | 201 if options.source_files: |
| 202 source_files += build_utils.ParseGypList(options.source_files) | 202 source_files += build_utils.ParseGnList(options.source_files) |
| 203 if options.java_sources_file: | 203 if options.java_sources_file: |
| 204 source_files.extend( | 204 source_files.extend( |
| 205 build_utils.ReadSourcesList(options.java_sources_file)) | 205 build_utils.ReadSourcesList(options.java_sources_file)) |
| 206 source_dirs = _GetSourceDirsFromSourceFiles(source_files) | 206 source_dirs = _GetSourceDirsFromSourceFiles(source_files) |
| 207 | 207 |
| 208 # TODO(GYP): In GN, we are passed the list of sources, detecting source | 208 # TODO(GYP): In GN, we are passed the list of sources, detecting source |
| 209 # directories, then walking them to re-establish the list of sources. | 209 # directories, then walking them to re-establish the list of sources. |
| 210 # This can obviously be simplified! | 210 # This can obviously be simplified! |
| 211 _CreateSourcesListFile(source_dirs, options.sources_list_file, | 211 _CreateSourcesListFile(source_dirs, options.sources_list_file, |
| 212 options.src_root) | 212 options.src_root) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 232 | 232 |
| 233 | 233 |
| 234 def main(): | 234 def main(): |
| 235 option_parser = command_option_parser.CommandOptionParser( | 235 option_parser = command_option_parser.CommandOptionParser( |
| 236 commands_dict=VALID_COMMANDS) | 236 commands_dict=VALID_COMMANDS) |
| 237 command_option_parser.ParseAndExecute(option_parser) | 237 command_option_parser.ParseAndExecute(option_parser) |
| 238 | 238 |
| 239 | 239 |
| 240 if __name__ == '__main__': | 240 if __name__ == '__main__': |
| 241 sys.exit(main()) | 241 sys.exit(main()) |
| OLD | NEW |