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 26 matching lines...) Expand all Loading... |
37 # target's dependencies. The .java files in these directories are not | 37 # target's dependencies. The .java files in these directories are not |
38 # included in the 'inputs' list (unlike additional_src_dirs). | 38 # included in the 'inputs' list (unlike additional_src_dirs). |
39 # input_jars_paths - The path to jars to be included in the classpath. This | 39 # input_jars_paths - The path to jars to be included in the classpath. This |
40 # should be filled automatically by depending on the appropriate targets. | 40 # should be filled automatically by depending on the appropriate targets. |
41 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 41 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
42 # dependencies from being re-included. | 42 # dependencies from being re-included. |
43 # native_lib_target - The target_name of the target which generates the final | 43 # native_lib_target - The target_name of the target which generates the final |
44 # shared library to be included in this apk. A stripped copy of the | 44 # shared library to be included in this apk. A stripped copy of the |
45 # library will be included in the apk. | 45 # library will be included in the apk. |
46 # resource_dir - The directory for resources. | 46 # resource_dir - The directory for resources. |
| 47 # shared_resources - Make a resource package that can be loaded by a different |
| 48 # application at runtime to access the package's resources. |
47 # R_package - A custom Java package to generate the resource file R.java in. | 49 # R_package - A custom Java package to generate the resource file R.java in. |
48 # By default, the package given in AndroidManifest.xml will be used. | 50 # By default, the package given in AndroidManifest.xml will be used. |
49 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he | 51 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he |
50 # RELRO section of the native libraries between the different processes. | 52 # RELRO section of the native libraries between the different processes. |
51 # load_library_from_zip_file - When using the dynamic linker, load the library | 53 # load_library_from_zip_file - When using the dynamic linker, load the library |
52 # directly out of the zip file. | 54 # directly out of the zip file. |
53 # use_relocation_packer - Enable relocation packing. Relies on the chromium | 55 # use_relocation_packer - Enable relocation packing. Relies on the chromium |
54 # linker, so use_chromium_linker must also be enabled. | 56 # linker, so use_chromium_linker must also be enabled. |
55 # enable_chromium_linker_tests - Enable the content dynamic linker test support | 57 # enable_chromium_linker_tests - Enable the content dynamic linker test support |
56 # code. This allows a test APK to inject a Linker.TestRunner instance at | 58 # code. This allows a test APK to inject a Linker.TestRunner instance at |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | 121 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', |
120 'dex_path': '<(intermediate_dir)/classes.dex', | 122 'dex_path': '<(intermediate_dir)/classes.dex', |
121 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 123 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
122 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 124 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
123 'push_stamp': '<(intermediate_dir)/push.stamp', | 125 'push_stamp': '<(intermediate_dir)/push.stamp', |
124 'link_stamp': '<(intermediate_dir)/link.stamp', | 126 'link_stamp': '<(intermediate_dir)/link.stamp', |
125 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', | 127 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', |
126 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | 128 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
127 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', | 129 'resource_packaged_apk_name': '<(apk_name)-resources.ap_', |
128 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n
ame)', | 130 'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_n
ame)', |
| 131 'shared_resources%': 0, |
129 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 132 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
130 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 133 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
131 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | 134 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
132 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | 135 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
133 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', | 136 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', |
134 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | 137 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
135 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', | 138 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', |
136 'create_standalone_apk%': 1, | 139 'create_standalone_apk%': 1, |
137 'res_v14_verify_only%': 0, | 140 'res_v14_verify_only%': 0, |
138 'variables': { | 141 'variables': { |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
568 # Write the inputs list to a file, so that its mtime is updated when | 571 # Write the inputs list to a file, so that its mtime is updated when |
569 # the list of inputs changes. | 572 # the list of inputs changes. |
570 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional
_input_paths) >@(resource_input_paths))', | 573 'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional
_input_paths) >@(resource_input_paths))', |
571 'process_resources_options': [], | 574 'process_resources_options': [], |
572 'conditions': [ | 575 'conditions': [ |
573 ['is_test_apk == 1', { | 576 ['is_test_apk == 1', { |
574 'dependencies_res_zip_paths=': [], | 577 'dependencies_res_zip_paths=': [], |
575 'additional_res_packages=': [], | 578 'additional_res_packages=': [], |
576 }], | 579 }], |
577 ['res_v14_verify_only == 1', { | 580 ['res_v14_verify_only == 1', { |
578 'process_resources_options': ['--v14-verify-only'] | 581 'process_resources_options+': ['--v14-verify-only'] |
| 582 }], |
| 583 ['shared_resources == 1', { |
| 584 'process_resources_options+': ['--shared-resources'] |
579 }], | 585 }], |
580 ], | 586 ], |
581 }, | 587 }, |
582 'inputs': [ | 588 'inputs': [ |
583 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 589 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
584 '<(DEPTH)/build/android/gyp/process_resources.py', | 590 '<(DEPTH)/build/android/gyp/process_resources.py', |
585 '<(android_manifest_path)', | 591 '<(android_manifest_path)', |
586 '>@(additional_input_paths)', | 592 '>@(additional_input_paths)', |
587 '>@(resource_input_paths)', | 593 '>@(resource_input_paths)', |
588 '>@(dependencies_res_zip_paths)', | 594 '>@(dependencies_res_zip_paths)', |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 }, { | 824 }, { |
819 'inputs': [ '<(instr_stamp)' ] | 825 'inputs': [ '<(instr_stamp)' ] |
820 }], | 826 }], |
821 ], | 827 ], |
822 'includes': [ 'android/dex_action.gypi' ], | 828 'includes': [ 'android/dex_action.gypi' ], |
823 }, | 829 }, |
824 { | 830 { |
825 'action_name': 'package_resources', | 831 'action_name': 'package_resources', |
826 'message': 'packaging resources for <(_target_name)', | 832 'message': 'packaging resources for <(_target_name)', |
827 'variables': { | 833 'variables': { |
| 834 'package_resources_options': [], |
828 'package_resource_zip_input_paths': [ | 835 'package_resource_zip_input_paths': [ |
829 '<(resource_zip_path)', | 836 '<(resource_zip_path)', |
830 '>@(dependencies_res_zip_paths)', | 837 '>@(dependencies_res_zip_paths)', |
831 ], | 838 ], |
| 839 'conditions': [ |
| 840 ['shared_resources == 1', { |
| 841 'package_resources_options+': ['--shared-resources'] |
| 842 }], |
| 843 ], |
832 }, | 844 }, |
833 'conditions': [ | 845 'conditions': [ |
834 ['is_test_apk == 1', { | 846 ['is_test_apk == 1', { |
835 'variables': { | 847 'variables': { |
836 'dependencies_res_zip_paths=': [], | 848 'dependencies_res_zip_paths=': [], |
837 'additional_res_packages=': [], | 849 'additional_res_packages=': [], |
838 } | 850 } |
839 }], | 851 }], |
840 ], | 852 ], |
841 'inputs': [ | 853 'inputs': [ |
(...skipping 19 matching lines...) Expand all Loading... |
861 '--android-manifest', '<(android_manifest_path)', | 873 '--android-manifest', '<(android_manifest_path)', |
862 '--version-code', '<(app_manifest_version_code)', | 874 '--version-code', '<(app_manifest_version_code)', |
863 '--version-name', '<(app_manifest_version_name)', | 875 '--version-name', '<(app_manifest_version_name)', |
864 | 876 |
865 '--asset-dir', '<(asset_location)', | 877 '--asset-dir', '<(asset_location)', |
866 '--resource-zips', '>(package_resource_zip_input_paths)', | 878 '--resource-zips', '>(package_resource_zip_input_paths)', |
867 | 879 |
868 '--no-compress', '<(extensions_to_not_compress)', | 880 '--no-compress', '<(extensions_to_not_compress)', |
869 | 881 |
870 '--apk-path', '<(resource_packaged_apk_path)', | 882 '--apk-path', '<(resource_packaged_apk_path)', |
| 883 |
| 884 '<@(package_resources_options)', |
871 ], | 885 ], |
872 }, | 886 }, |
873 { | 887 { |
874 'action_name': 'ant_package_<(_target_name)', | 888 'action_name': 'ant_package_<(_target_name)', |
875 'message': 'Packaging <(_target_name)', | 889 'message': 'Packaging <(_target_name)', |
876 'variables': { | 890 'variables': { |
877 # Write the inputs list to a file, so that its mtime is updated when | 891 # Write the inputs list to a file, so that its mtime is updated when |
878 # the list of inputs changes. | 892 # the list of inputs changes. |
879 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_in
put_paths))' | 893 'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_in
put_paths))' |
880 }, | 894 }, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 '-DEMMA_INSTRUMENT=<(emma_instrument)', | 927 '-DEMMA_INSTRUMENT=<(emma_instrument)', |
914 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', | 928 '-DEMMA_DEVICE_JAR=<(emma_device_jar)', |
915 | 929 |
916 '-Dbasedir=.', | 930 '-Dbasedir=.', |
917 '-buildfile', | 931 '-buildfile', |
918 '<(DEPTH)/build/android/ant/apk-package.xml', | 932 '<(DEPTH)/build/android/ant/apk-package.xml', |
919 ] | 933 ] |
920 }, | 934 }, |
921 ], | 935 ], |
922 } | 936 } |
OLD | NEW |