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). |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
456 options.all_resources_zip_out, | 456 options.all_resources_zip_out, |
457 options.proguard_file, | 457 options.proguard_file, |
458 options.r_text_out, | 458 options.r_text_out, |
459 options.srcjar_out, | 459 options.srcjar_out, |
460 ] | 460 ] |
461 output_paths = [x for x in possible_output_paths if x] | 461 output_paths = [x for x in possible_output_paths if x] |
462 | 462 |
463 # List python deps in input_strings rather than input_paths since the contents | 463 # List python deps in input_strings rather than input_paths since the contents |
464 # of them does not change what gets written to the depsfile. | 464 # of them does not change what gets written to the depsfile. |
465 input_strings = options.extra_res_packages + [ | 465 input_strings = options.extra_res_packages + [ |
466 options.aapt_path, | |
467 options.android_sdk_jar, | |
468 options.app_as_shared_lib, | 466 options.app_as_shared_lib, |
469 options.custom_package, | 467 options.custom_package, |
470 options.include_all_resources, | 468 options.include_all_resources, |
471 options.non_constant_id, | 469 options.non_constant_id, |
472 options.shared_resources, | 470 options.shared_resources, |
473 options.v14_skip, | 471 options.v14_skip, |
474 ] | 472 ] |
475 | 473 |
476 input_paths = [ options.android_manifest ] | 474 input_paths = [ |
| 475 options.aapt_path, |
| 476 options.android_manifest, |
| 477 options.android_sdk_jar, |
| 478 ] |
477 input_paths.extend(options.dependencies_res_zips) | 479 input_paths.extend(options.dependencies_res_zips) |
478 input_paths.extend(p for p in options.extra_r_text_files if os.path.exists(p)) | 480 input_paths.extend(p for p in options.extra_r_text_files if os.path.exists(p)) |
479 | 481 |
480 resource_names = [] | 482 resource_names = [] |
481 for resource_dir in options.resource_dirs: | 483 for resource_dir in options.resource_dirs: |
482 for resource_file in build_utils.FindInDirectory(resource_dir, '*'): | 484 for resource_file in build_utils.FindInDirectory(resource_dir, '*'): |
483 input_paths.append(resource_file) | 485 input_paths.append(resource_file) |
484 resource_names.append(os.path.relpath(resource_file, resource_dir)) | 486 resource_names.append(os.path.relpath(resource_file, resource_dir)) |
485 | 487 |
486 # Resource filenames matter to the output, so add them to strings as well. | 488 # Resource filenames matter to the output, so add them to strings as well. |
487 # This matters if a file is renamed but not changed (http://crbug.com/597126). | 489 # This matters if a file is renamed but not changed (http://crbug.com/597126). |
488 input_strings.extend(sorted(resource_names)) | 490 input_strings.extend(sorted(resource_names)) |
489 | 491 |
490 build_utils.CallAndWriteDepfileIfStale( | 492 build_utils.CallAndWriteDepfileIfStale( |
491 lambda: _OnStaleMd5(options), | 493 lambda: _OnStaleMd5(options), |
492 options, | 494 options, |
493 input_paths=input_paths, | 495 input_paths=input_paths, |
494 input_strings=input_strings, | 496 input_strings=input_strings, |
495 output_paths=output_paths, | 497 output_paths=output_paths, |
496 # TODO(agrieve): Remove R_dir when it's no longer used (used only by GYP). | 498 # TODO(agrieve): Remove R_dir when it's no longer used (used only by GYP). |
497 force=options.R_dir) | 499 force=options.R_dir) |
498 | 500 |
499 | 501 |
500 if __name__ == '__main__': | 502 if __name__ == '__main__': |
501 main(sys.argv[1:]) | 503 main(sys.argv[1:]) |
OLD | NEW |