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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 469 |
470 cur_package = options.custom_package | 470 cur_package = options.custom_package |
471 if not options.custom_package: | 471 if not options.custom_package: |
472 cur_package = _ExtractPackageFromManifest(options.android_manifest) | 472 cur_package = _ExtractPackageFromManifest(options.android_manifest) |
473 | 473 |
474 # Don't create a .java file for the current resource target when: | 474 # Don't create a .java file for the current resource target when: |
475 # - no package name was provided (either by manifest or build rules), | 475 # - no package name was provided (either by manifest or build rules), |
476 # - there was already a dependent android_resources() with the same | 476 # - there was already a dependent android_resources() with the same |
477 # package (occurs mostly when an apk target and resources target share | 477 # package (occurs mostly when an apk target and resources target share |
478 # an AndroidManifest.xml) | 478 # an AndroidManifest.xml) |
479 if cur_package != 'dummy.package' and cur_package not in packages: | 479 if cur_package != 'org.dummy' and cur_package not in packages: |
480 packages.append(cur_package) | 480 packages.append(cur_package) |
481 r_txt_files.append(r_txt_path) | 481 r_txt_files.append(r_txt_path) |
482 | 482 |
483 if packages: | 483 if packages: |
484 shared_resources = options.shared_resources or options.app_as_shared_lib | 484 shared_resources = options.shared_resources or options.app_as_shared_lib |
485 CreateRJavaFiles(srcjar_dir, r_txt_path, packages, r_txt_files, | 485 CreateRJavaFiles(srcjar_dir, r_txt_path, packages, r_txt_files, |
486 shared_resources) | 486 shared_resources) |
487 | 487 |
488 # This is the list of directories with resources to put in the final .zip | 488 # This is the list of directories with resources to put in the final .zip |
489 # file. The order of these is important so that crunched/v14 resources | 489 # file. The order of these is important so that crunched/v14 resources |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 options, | 565 options, |
566 input_paths=input_paths, | 566 input_paths=input_paths, |
567 input_strings=input_strings, | 567 input_strings=input_strings, |
568 output_paths=output_paths, | 568 output_paths=output_paths, |
569 # TODO(agrieve): Remove R_dir when it's no longer used (used only by GYP). | 569 # TODO(agrieve): Remove R_dir when it's no longer used (used only by GYP). |
570 force=options.R_dir) | 570 force=options.R_dir) |
571 | 571 |
572 | 572 |
573 if __name__ == '__main__': | 573 if __name__ == '__main__': |
574 main(sys.argv[1:]) | 574 main(sys.argv[1:]) |
OLD | NEW |