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 'res_v14_verify_only%': 0, | 147 'res_v14_verify_only%': 0, |
144 'variables': { | 148 'variables': { |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
571 '--main-manifest', '<(android_manifest_path)', | 575 '--main-manifest', '<(android_manifest_path)', |
572 '--out-manifest', '<(split_android_manifest_path)', | 576 '--out-manifest', '<(split_android_manifest_path)', |
573 '--split', 'abi_<(android_app_abi)', | 577 '--split', 'abi_<(android_app_abi)', |
574 ], | 578 ], |
575 }, | 579 }, |
576 { | 580 { |
577 'variables': { | 581 'variables': { |
578 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', | 582 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', |
579 'asset_location': '', | 583 'asset_location': '', |
580 'android_manifest_path': '<(split_android_manifest_path)', | 584 'android_manifest_path': '<(split_android_manifest_path)', |
585 'create_density_splits': 0, | |
581 }, | 586 }, |
582 'includes': [ 'android/package_resources_action.gypi' ], | 587 'includes': [ 'android/package_resources_action.gypi' ], |
583 }, | 588 }, |
584 { | 589 { |
585 'variables': { | 590 'variables': { |
586 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', | 591 'apk_name': '<(main_apk_name)-abi-<(android_app_abi)', |
587 'apk_path': '<(unsigned_abi_split_apk_path)', | 592 'apk_path': '<(unsigned_abi_split_apk_path)', |
588 'has_code': 0, | 593 'has_code': 0, |
589 'native_libs_dir': '<(apk_package_native_libs_dir)', | 594 'native_libs_dir': '<(apk_package_native_libs_dir)', |
590 'extra_inputs': ['<(native_lib_placeholder_stamp)'], | 595 'extra_inputs': ['<(native_lib_placeholder_stamp)'], |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
633 '<(incomplete_apk_path)', | 638 '<(incomplete_apk_path)', |
634 ], | 639 ], |
635 'outputs': [ | 640 'outputs': [ |
636 '<(apk_install_record)', | 641 '<(apk_install_record)', |
637 ], | 642 ], |
638 'action': [ | 643 'action': [ |
639 'python', '<(DEPTH)/build/android/gyp/apk_install.py', | 644 'python', '<(DEPTH)/build/android/gyp/apk_install.py', |
640 '--build-device-configuration=<(build_device_config_path)', | 645 '--build-device-configuration=<(build_device_config_path)', |
641 '--install-record=<(apk_install_record)', | 646 '--install-record=<(apk_install_record)', |
642 '--configuration-name=<(CONFIGURATION_NAME)', | 647 '--configuration-name=<(CONFIGURATION_NAME)', |
648 '--android-sdk-tools', '<(android_sdk_tools)', | |
643 ], | 649 ], |
644 'conditions': [ | 650 'conditions': [ |
645 ['create_abi_split == 1', { | 651 ['create_abi_split == 1', { |
646 'inputs': [ | 652 'inputs': [ |
647 '<(final_apk_path)', | 653 '<(final_apk_path)', |
648 ], | 654 ], |
649 'action': [ | 655 'action': [ |
650 '--apk-path=<(final_apk_path)', | 656 '--apk-path=<(final_apk_path)', |
651 '--split-apk-path=<(incomplete_apk_path)', | 657 '--split-apk-path=<(incomplete_apk_path)', |
652 ], | 658 ], |
653 }, { | 659 }, { |
654 'action': [ | 660 'action': [ |
655 '--apk-path=<(incomplete_apk_path)', | 661 '--apk-path=<(incomplete_apk_path)', |
656 ], | 662 ], |
657 }] | 663 }], |
664 ['create_density_splits == 1', { | |
665 'inputs': [ | |
666 '<(final_apk_path_no_extension)-density-hdpi.apk', | |
667 '<(final_apk_path_no_extension)-density-xdpi.apk', | |
cjhopman
2015/05/20 01:51:51
should these be xhdpi/xxhdpi?
agrieve
2015/05/20 14:49:36
Done.
| |
668 '<(final_apk_path_no_extension)-density-xxdpi.apk', | |
669 '<(final_apk_path_no_extension)-density-tvdpi.apk', | |
670 ], | |
671 'action': [ | |
672 '--split-apk-path=<(final_apk_path_no_extension)-density-hdpi.ap k', | |
673 '--split-apk-path=<(final_apk_path_no_extension)-density-xhdpi.a pk', | |
674 '--split-apk-path=<(final_apk_path_no_extension)-density-xxhdpi. apk', | |
675 '--split-apk-path=<(final_apk_path_no_extension)-density-tvdpi.a pk', | |
676 ], | |
677 }], | |
658 ], | 678 ], |
659 }, | 679 }, |
660 ], | 680 ], |
661 }], | 681 }], |
682 ['create_density_splits == 1', { | |
683 'actions': [ | |
684 { | |
685 'action_name': 'finalize_density_splits', | |
686 'variables': { | |
687 'density_splits': 1, | |
688 }, | |
689 'includes': [ 'android/finalize_splits_action.gypi'] | |
690 }, | |
691 ], | |
692 }], | |
662 ['is_test_apk == 1', { | 693 ['is_test_apk == 1', { |
663 'dependencies': [ | 694 'dependencies': [ |
664 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm ands', | 695 '<(DEPTH)/build/android/pylib/device/commands/commands.gyp:chromium_comm ands', |
665 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', | 696 '<(DEPTH)/tools/android/android_tools.gyp:android_tools', |
666 ] | 697 ] |
667 }], | 698 }], |
668 ['run_findbugs == 1', { | 699 ['run_findbugs == 1', { |
669 'actions': [ | 700 'actions': [ |
670 { | 701 { |
671 'action_name': 'findbugs_<(_target_name)', | 702 'action_name': 'findbugs_<(_target_name)', |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
994 'native_libs_dir': '<(apk_package_native_libs_dir)', | 1025 'native_libs_dir': '<(apk_package_native_libs_dir)', |
995 }, { | 1026 }, { |
996 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', | 1027 'native_libs_dir': '<(DEPTH)/build/android/ant/empty/res', |
997 }], | 1028 }], |
998 ], | 1029 ], |
999 }, | 1030 }, |
1000 'includes': ['android/apkbuilder_action.gypi'], | 1031 'includes': ['android/apkbuilder_action.gypi'], |
1001 }, | 1032 }, |
1002 ], | 1033 ], |
1003 } | 1034 } |
OLD | NEW |