OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # This file is meant to be included into a target to provide a rule | 5 # This file is meant to be included into a target to provide a rule |
6 # to build Android APKs in a consistent manner. | 6 # to build Android APKs in a consistent manner. |
7 # | 7 # |
8 # To use this, create a gyp target with the following form: | 8 # To use this, create a gyp target with the following form: |
9 # { | 9 # { |
10 # 'target_name': 'my_package_apk', | 10 # 'target_name': 'my_package_apk', |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 'javac_includes': [], | 97 'javac_includes': [], |
98 'jar_excluded_classes': [], | 98 'jar_excluded_classes': [], |
99 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 99 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
100 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 100 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
101 'dex_path': '<(intermediate_dir)/classes.dex', | 101 'dex_path': '<(intermediate_dir)/classes.dex', |
102 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 102 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
103 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 103 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
104 'push_stamp': '<(intermediate_dir)/push.stamp', | 104 'push_stamp': '<(intermediate_dir)/push.stamp', |
105 'link_stamp': '<(intermediate_dir)/link.stamp', | 105 'link_stamp': '<(intermediate_dir)/link.stamp', |
106 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', | 106 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', |
| 107 'crunch_output_dir': '<(intermediate_dir)/res', |
| 108 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', |
| 109 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n
ame)', |
107 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 110 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
108 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 111 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
109 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | 112 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
110 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | 113 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
111 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', | 114 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', |
112 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | 115 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
113 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', | 116 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', |
114 'create_standalone_apk%': 1, | 117 'create_standalone_apk%': 1, |
115 'variables': { | 118 'variables': { |
116 'variables': { | 119 'variables': { |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
469 | 472 |
470 '--android-manifest', '<(android_manifest_path)', | 473 '--android-manifest', '<(android_manifest_path)', |
471 '--dependencies-res-dirs', '>(additional_res_dirs)', | 474 '--dependencies-res-dirs', '>(additional_res_dirs)', |
472 | 475 |
473 '--extra-res-packages', '>(additional_res_packages)', | 476 '--extra-res-packages', '>(additional_res_packages)', |
474 '--extra-r-text-files', '>(additional_R_text_files)', | 477 '--extra-r-text-files', '>(additional_R_text_files)', |
475 | 478 |
476 '--proguard-file', '<(generated_proguard_file)', | 479 '--proguard-file', '<(generated_proguard_file)', |
477 | 480 |
478 '--resource-dir', '<(resource_dir)', | 481 '--resource-dir', '<(resource_dir)', |
479 '--crunch-output-dir', '<(intermediate_dir)/res', | 482 '--crunch-output-dir', '<(crunch_output_dir)', |
480 | 483 |
481 '--R-dir', '<(intermediate_dir)/gen', | 484 '--R-dir', '<(intermediate_dir)/gen', |
482 | 485 |
483 '--stamp', '<(codegen_stamp)', | 486 '--stamp', '<(codegen_stamp)', |
484 ], | 487 ], |
485 }, | 488 }, |
486 { | 489 { |
487 'action_name': 'javac_<(_target_name)', | 490 'action_name': 'javac_<(_target_name)', |
488 'message': 'Compiling java for <(_target_name)', | 491 'message': 'Compiling java for <(_target_name)', |
489 'variables': { | 492 'variables': { |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 'output_path': '<(dex_path)', | 642 'output_path': '<(dex_path)', |
640 'proguard_enabled_input_path': '<(obfuscated_jar_path)', | 643 'proguard_enabled_input_path': '<(obfuscated_jar_path)', |
641 }, | 644 }, |
642 'conditions': [ | 645 'conditions': [ |
643 ['proguard_enabled == "true"', { 'inputs': [ '<(obfuscate_stamp)' ] }, | 646 ['proguard_enabled == "true"', { 'inputs': [ '<(obfuscate_stamp)' ] }, |
644 { 'inputs': [ '<(instr_stamp)' ] }], | 647 { 'inputs': [ '<(instr_stamp)' ] }], |
645 ], | 648 ], |
646 'includes': [ 'android/dex_action.gypi' ], | 649 'includes': [ 'android/dex_action.gypi' ], |
647 }, | 650 }, |
648 { | 651 { |
649 'action_name': 'ant package resources', | 652 'action_name': 'package_resources', |
650 'message': 'Packaging resources for <(_target_name) APK', | 653 'message': 'packaging resources for <(_target_name)', |
651 'inputs': [ | 654 'variables': { |
652 '<(DEPTH)/build/android/ant/apk-package-resources.xml', | 655 'extra_package_input_paths': [ |
653 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 656 '>@(package_input_paths)', |
654 '<(DEPTH)/build/android/gyp/ant.py', | 657 '>@(additional_input_paths)', |
655 '<(android_manifest_path)', | 658 '>@(resource_input_paths)' |
656 '<(codegen_stamp)', | 659 ], |
657 # TODO: This isn't always rerun correctly, http://crbug.com/351928 | 660 'package_resource_dirs': [ |
658 | 661 # <(crunch_output_dir) must come before <(resource_dir) so that |
659 '>@(additional_input_paths)', | 662 # the crunched files take precedence. |
660 ], | 663 '<(crunch_output_dir)', |
| 664 '<(resource_dir)', |
| 665 '>@(additional_res_dirs)', |
| 666 ], |
| 667 # Write the inputs list to a file, so that its mtime is updated when |
| 668 # the list of inputs changes. |
| 669 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(extra_pack
age_input_paths))', |
| 670 }, |
661 'conditions': [ | 671 'conditions': [ |
662 ['is_test_apk == 1', { | 672 ['is_test_apk == 1', { |
663 'variables': { | 673 'variables': { |
664 'additional_res_dirs=': [], | 674 'additional_res_dirs=': [], |
665 'additional_res_packages=': [], | 675 'additional_res_packages=': [], |
666 } | 676 } |
667 }], | 677 }], |
668 ], | 678 ], |
| 679 'inputs': [ |
| 680 # TODO: This isn't always rerun correctly, http://crbug.com/351928 |
| 681 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 682 '<(DEPTH)/build/android/gyp/package_resources.py', |
| 683 '<(android_manifest_path)', |
| 684 |
| 685 '<(codegen_stamp)', |
| 686 |
| 687 '>@(extra_package_input_paths)', |
| 688 '>(inputs_list_file)', |
| 689 ], |
669 'outputs': [ | 690 'outputs': [ |
670 '<(package_resources_stamp)', | 691 '<(resource_packaged_apk_path)', |
671 ], | 692 ], |
672 'action': [ | 693 'action': [ |
673 'python', '<(DEPTH)/build/android/gyp/ant.py', | 694 'python', '<(DEPTH)/build/android/gyp/package_resources.py', |
674 '-quiet', | 695 '--android-sdk', '<(android_sdk)', |
675 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 696 '--android-sdk-tools', '<(android_sdk_tools)', |
676 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | |
677 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | |
678 '-DANDROID_MANIFEST=<(android_manifest_path)', | |
679 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | |
680 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | |
681 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | |
682 '-DAPK_NAME=<(apk_name)', | |
683 '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', | |
684 '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', | |
685 '-DASSET_DIR=<(asset_location)', | |
686 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | |
687 '-DOUT_DIR=<(intermediate_dir)', | |
688 '-DRESOURCE_DIR=<(resource_dir)', | |
689 | 697 |
690 '-DSTAMP=<(package_resources_stamp)', | 698 '--configuration-name', '<(CONFIGURATION_NAME)', |
691 | 699 |
692 '-Dbasedir=.', | 700 '--android-manifest', '<(android_manifest_path)', |
693 '-buildfile', | 701 '--version-code', '<(app_manifest_version_code)', |
694 '<(DEPTH)/build/android/ant/apk-package-resources.xml', | 702 '--version-name', '<(app_manifest_version_name)', |
695 ] | 703 |
| 704 '--asset-dir', '<(asset_location)', |
| 705 '--resource-dirs', '>(package_resource_dirs)', |
| 706 |
| 707 '--apk-path', '<(resource_packaged_apk_path)', |
| 708 ], |
696 }, | 709 }, |
697 { | 710 { |
698 'action_name': 'ant_package_<(_target_name)', | 711 'action_name': 'ant_package_<(_target_name)', |
699 'message': 'Packaging <(_target_name)', | 712 'message': 'Packaging <(_target_name)', |
700 'variables': { | 713 'variables': { |
701 # Write the inputs list to a file, so that its mtime is updated when | 714 # Write the inputs list to a file, so that its mtime is updated when |
702 # the list of inputs changes. | 715 # the list of inputs changes. |
703 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_in
put_paths))' | 716 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_in
put_paths))' |
704 }, | 717 }, |
705 'inputs': [ | 718 'inputs': [ |
706 '<(DEPTH)/build/android/ant/apk-package.xml', | 719 '<(DEPTH)/build/android/ant/apk-package.xml', |
707 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 720 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
708 '<(DEPTH)/build/android/gyp/ant.py', | 721 '<(DEPTH)/build/android/gyp/ant.py', |
709 '<(dex_path)', | 722 '<(dex_path)', |
710 '<(codegen_stamp)', | 723 '<(codegen_stamp)', |
711 '<(obfuscate_stamp)', | 724 '<(obfuscate_stamp)', |
712 '<(package_resources_stamp)', | 725 '<(resource_packaged_apk_path)', |
713 '>@(package_input_paths)', | 726 '>@(package_input_paths)', |
714 '>(inputs_list_file)', | 727 '>(inputs_list_file)', |
715 ], | 728 ], |
716 'outputs': [ | 729 'outputs': [ |
717 '<(unsigned_apk_path)', | 730 '<(unsigned_apk_path)', |
718 ], | 731 ], |
719 'action': [ | 732 'action': [ |
720 'python', '<(DEPTH)/build/android/gyp/ant.py', | 733 'python', '<(DEPTH)/build/android/gyp/ant.py', |
721 '-quiet', | 734 '-quiet', |
722 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 735 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
723 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | 736 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', |
| 737 '-DRESOURCE_PACKAGED_APK_NAME=<(resource_packaged_apk_name)', |
724 '-DAPK_NAME=<(apk_name)', | 738 '-DAPK_NAME=<(apk_name)', |
725 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', | 739 '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', |
726 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', | 740 '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', |
727 '-DOUT_DIR=<(intermediate_dir)', | 741 '-DOUT_DIR=<(intermediate_dir)', |
728 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', | 742 '-DUNSIGNED_APK_PATH=<(unsigned_apk_path)', |
729 '-DEMMA_INSTRUMENT=<(emma_instrument)', | 743 '-DEMMA_INSTRUMENT=<(emma_instrument)', |
730 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', | 744 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', |
731 | 745 |
732 '-Dbasedir=.', | 746 '-Dbasedir=.', |
733 '-buildfile', | 747 '-buildfile', |
734 '<(DEPTH)/build/android/ant/apk-package.xml', | 748 '<(DEPTH)/build/android/ant/apk-package.xml', |
735 ] | 749 ] |
736 }, | 750 }, |
737 ], | 751 ], |
738 } | 752 } |
OLD | NEW |