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 13 matching lines...) Expand all Loading... |
24 # Optional/automatic variables: | 24 # Optional/automatic variables: |
25 # additional_input_paths - These paths will be included in the 'inputs' list to | 25 # additional_input_paths - These paths will be included in the 'inputs' list to |
26 # ensure that this target is rebuilt when one of these paths changes. | 26 # ensure that this target is rebuilt when one of these paths changes. |
27 # additional_res_packages - Package names of R.java files generated in addition | 27 # additional_res_packages - Package names of R.java files generated in addition |
28 # to the default package name defined in AndroidManifest.xml. | 28 # to the default package name defined in AndroidManifest.xml. |
29 # additional_src_dirs - Additional directories with .java files to be compiled | 29 # additional_src_dirs - Additional directories with .java files to be compiled |
30 # and included in the output of this target. | 30 # and included in the output of this target. |
31 # additional_bundled_libs - Additional libraries what will be stripped and | 31 # additional_bundled_libs - Additional libraries what will be stripped and |
32 # bundled in the apk. | 32 # bundled in the apk. |
33 # asset_location - The directory where assets are located. | 33 # asset_location - The directory where assets are located. |
| 34 # create_density_splits - Whether to create density-based apk splits. Splits |
| 35 # are supported only for minSdkVersion >= 21. |
34 # generated_src_dirs - Same as additional_src_dirs except used for .java files | 36 # generated_src_dirs - Same as additional_src_dirs except used for .java files |
35 # that are generated at build time. This should be set automatically by a | 37 # that are generated at build time. This should be set automatically by a |
36 # target's dependencies. The .java files in these directories are not | 38 # target's dependencies. The .java files in these directories are not |
37 # included in the 'inputs' list (unlike additional_src_dirs). | 39 # included in the 'inputs' list (unlike additional_src_dirs). |
38 # input_jars_paths - The path to jars to be included in the classpath. This | 40 # input_jars_paths - The path to jars to be included in the classpath. This |
39 # should be filled automatically by depending on the appropriate targets. | 41 # should be filled automatically by depending on the appropriate targets. |
40 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 42 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
41 # dependencies from being re-included. | 43 # dependencies from being re-included. |
42 # native_lib_target - The target_name of the target which generates the final | 44 # native_lib_target - The target_name of the target which generates the final |
43 # shared library to be included in this apk. A stripped copy of the | 45 # shared library to be included in this apk. A stripped copy of the |
(...skipping 16 matching lines...) Expand all Loading... |
60 # runtime. Should only be used by the chromium_linker_test_apk target!! | 62 # runtime. Should only be used by the chromium_linker_test_apk target!! |
61 # never_lint - Set to 1 to not run lint on this target. | 63 # never_lint - Set to 1 to not run lint on this target. |
62 # java_in_dir_suffix - To override the /src suffix on java_in_dir. | 64 # java_in_dir_suffix - To override the /src suffix on java_in_dir. |
63 # app_manifest_version_name - set the apps 'human readable' version number. | 65 # app_manifest_version_name - set the apps 'human readable' version number. |
64 # app_manifest_version_code - set the apps version number. | 66 # app_manifest_version_code - set the apps version number. |
65 { | 67 { |
66 'variables': { | 68 'variables': { |
67 'tested_apk_obfuscated_jar_path%': '/', | 69 'tested_apk_obfuscated_jar_path%': '/', |
68 'tested_apk_dex_path%': '/', | 70 'tested_apk_dex_path%': '/', |
69 'additional_input_paths': [], | 71 'additional_input_paths': [], |
| 72 'create_density_splits%': 0, |
70 'input_jars_paths': [], | 73 'input_jars_paths': [], |
71 'library_dexed_jars_paths': [], | 74 'library_dexed_jars_paths': [], |
72 'additional_src_dirs': [], | 75 'additional_src_dirs': [], |
73 'generated_src_dirs': [], | 76 'generated_src_dirs': [], |
74 'app_manifest_version_name%': '<(android_app_version_name)', | 77 'app_manifest_version_name%': '<(android_app_version_name)', |
75 'app_manifest_version_code%': '<(android_app_version_code)', | 78 'app_manifest_version_code%': '<(android_app_version_code)', |
76 # aapt generates this proguard.txt. | 79 # aapt generates this proguard.txt. |
77 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', | 80 'generated_proguard_file': '<(intermediate_dir)/proguard.txt', |
78 'proguard_enabled%': 'false', | 81 'proguard_enabled%': 'false', |
79 'proguard_flags_paths': ['<(generated_proguard_file)'], | 82 'proguard_flags_paths': ['<(generated_proguard_file)'], |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', | 128 'test_jar_path': '<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar', |
126 'dex_path': '<(intermediate_dir)/classes.dex', | 129 'dex_path': '<(intermediate_dir)/classes.dex', |
127 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 130 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
128 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 131 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
129 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi
d_app_abi)/AndroidManifest.xml', | 132 'split_android_manifest_path': '<(intermediate_dir)/split-manifests/<(androi
d_app_abi)/AndroidManifest.xml', |
130 'push_stamp': '<(intermediate_dir)/push.stamp', | 133 'push_stamp': '<(intermediate_dir)/push.stamp', |
131 'link_stamp': '<(intermediate_dir)/link.stamp', | 134 'link_stamp': '<(intermediate_dir)/link.stamp', |
132 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', | 135 'resource_zip_path': '<(intermediate_dir)/<(_target_name).resources.zip', |
133 'shared_resources%': 0, | 136 'shared_resources%': 0, |
134 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 137 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| 138 'final_apk_path_no_extension%': '<(PRODUCT_DIR)/apks/<(apk_name)', |
135 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_
app_abi).apk', | 139 'final_abi_split_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name)-abi-<(android_
app_abi).apk', |
136 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | 140 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
137 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | 141 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
138 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', | 142 'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_t
arget_name)/<(CONFIGURATION_NAME)', |
139 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | 143 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
140 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', | 144 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', |
141 'create_standalone_apk%': 1, | 145 'create_standalone_apk%': 1, |
142 'res_v14_skip%': 0, | 146 'res_v14_skip%': 0, |
143 'variables': { | 147 'variables': { |
144 'variables': { | 148 'variables': { |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 '--main-manifest', '<(android_manifest_path)', | 573 '--main-manifest', '<(android_manifest_path)', |
570 '--out-manifest', '<(split_android_manifest_path)', | 574 '--out-manifest', '<(split_android_manifest_path)', |
571 '--split', 'abi_<(android_app_abi)', | 575 '--split', 'abi_<(android_app_abi)', |
572 ], | 576 ], |
573 }, | 577 }, |
574 { | 578 { |
575 'variables': { | 579 'variables': { |
576 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', | 580 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', |
577 'asset_location': '', | 581 'asset_location': '', |
578 'android_manifest_path': '<(split_android_manifest_path)', | 582 'android_manifest_path': '<(split_android_manifest_path)', |
| 583 'create_density_splits': 0, |
579 }, | 584 }, |
580 'includes': [ 'android/package_resources_action.gypi' ], | 585 'includes': [ 'android/package_resources_action.gypi' ], |
581 }, | 586 }, |
582 { | 587 { |
583 'variables': { | 588 'variables': { |
584 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', | 589 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', |
585 'apk_path': '<(unsigned_abi_split_apk_path)', | 590 'apk_path': '<(unsigned_abi_split_apk_path)', |
586 'has_code': 0, | 591 'has_code': 0, |
587 'native_libs_dir': '<(apk_package_native_libs_dir)', | 592 'native_libs_dir': '<(apk_package_native_libs_dir)', |
588 'extra_inputs': ['<(native_lib_placeholder_stamp)'], | 593 'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
644 '<(final_apk_path)', | 649 '<(final_apk_path)', |
645 ], | 650 ], |
646 'action': [ | 651 'action': [ |
647 '--apk-path=<(final_apk_path)', | 652 '--apk-path=<(final_apk_path)', |
648 '--split-apk-path=<(incomplete_apk_path)', | 653 '--split-apk-path=<(incomplete_apk_path)', |
649 ], | 654 ], |
650 }, { | 655 }, { |
651 'action': [ | 656 'action': [ |
652 '--apk-path=<(incomplete_apk_path)', | 657 '--apk-path=<(incomplete_apk_path)', |
653 ], | 658 ], |
654 }] | 659 }], |
| 660 ['create_density_splits == 1', { |
| 661 'inputs': [ |
| 662 '<(final_apk_path_no_extension)-density-hdpi.apk', |
| 663 '<(final_apk_path_no_extension)-density-xhdpi.apk', |
| 664 '<(final_apk_path_no_extension)-density-xxhdpi.apk', |
| 665 '<(final_apk_path_no_extension)-density-tvdpi.apk', |
| 666 ], |
| 667 'action': [ |
| 668 '--split-apk-path=<(final_apk_path_no_extension)-density-hdpi.ap
k', |
| 669 '--split-apk-path=<(final_apk_path_no_extension)-density-xhdpi.a
pk', |
| 670 '--split-apk-path=<(final_apk_path_no_extension)-density-xxhdpi.
apk', |
| 671 '--split-apk-path=<(final_apk_path_no_extension)-density-tvdpi.a
pk', |
| 672 ], |
| 673 }], |
655 ], | 674 ], |
656 }, | 675 }, |
657 ], | 676 ], |
658 }], | 677 }], |
| 678 ['create_density_splits == 1', { |
| 679 'actions': [ |
| 680 { |
| 681 'action_name': 'finalize_density_splits', |
| 682 'variables': { |
| 683 'density_splits': 1, |
| 684 }, |
| 685 'includes': [ 'android/finalize_splits_action.gypi'] |
| 686 }, |
| 687 ], |
| 688 }], |
659 ['is_test_apk == 1', { | 689 ['is_test_apk == 1', { |
660 'dependencies': [ | 690 'dependencies': [ |
661 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', | 691 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm
ands', |
662 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', | 692 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', |
663 ] | 693 ] |
664 }], | 694 }], |
665 ['run_findbugs == 1', { | 695 ['run_findbugs == 1', { |
666 'actions': [ | 696 'actions': [ |
667 { | 697 { |
668 'action_name': 'findbugs_<(_target_name)', | 698 'action_name': 'findbugs_<(_target_name)', |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 'native_libs_dir': '<(apk_package_native_libs_dir)', | 1018 'native_libs_dir': '<(apk_package_native_libs_dir)', |
989 }, { | 1019 }, { |
990 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | 1020 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
991 }], | 1021 }], |
992 ], | 1022 ], |
993 }, | 1023 }, |
994 'includes': ['android/apkbuilder_action.gypi'], | 1024 'includes': ['android/apkbuilder_action.gypi'], |
995 }, | 1025 }, |
996 ], | 1026 ], |
997 } | 1027 } |
OLD | NEW |