| 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 28 matching lines...) Expand all Loading... |
| 39 # is_test_apk - Set to 1 if building a test apk. This prevents resources from | 39 # is_test_apk - Set to 1 if building a test apk. This prevents resources from |
| 40 # dependencies from being re-included. | 40 # dependencies from being re-included. |
| 41 # native_lib_target - The target_name of the target which generates the final | 41 # native_lib_target - The target_name of the target which generates the final |
| 42 # shared library to be included in this apk. A stripped copy of the | 42 # shared library to be included in this apk. A stripped copy of the |
| 43 # library will be included in the apk. | 43 # library will be included in the apk. |
| 44 # resource_dir - The directory for resources. | 44 # resource_dir - The directory for resources. |
| 45 # R_package - A custom Java package to generate the resource file R.java in. | 45 # R_package - A custom Java package to generate the resource file R.java in. |
| 46 # By default, the package given in AndroidManifest.xml will be used. | 46 # By default, the package given in AndroidManifest.xml will be used. |
| 47 # java_strings_grd - The name of the grd file from which to generate localized | 47 # java_strings_grd - The name of the grd file from which to generate localized |
| 48 # strings.xml files, if any. | 48 # strings.xml files, if any. |
| 49 # library_manifest_paths'- Paths to additional AndroidManifest.xml files from | |
| 50 # libraries. | |
| 51 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he | 49 # use_chromium_linker - Enable the content dynamic linker that allows sharing t
he |
| 52 # RELRO section of the native libraries between the different processes. | 50 # RELRO section of the native libraries between the different processes. |
| 53 # enable_chromium_linker_tests - Enable the content dynamic linker test support | 51 # enable_chromium_linker_tests - Enable the content dynamic linker test support |
| 54 # code. This allows a test APK to inject a Linker.TestRunner instance at | 52 # code. This allows a test APK to inject a Linker.TestRunner instance at |
| 55 # runtime. Should only be used by the chromium_linker_test_apk target!! | 53 # runtime. Should only be used by the chromium_linker_test_apk target!! |
| 56 # never_lint - Set to 1 to not run lint on this target. | 54 # never_lint - Set to 1 to not run lint on this target. |
| 57 { | 55 { |
| 58 'variables': { | 56 'variables': { |
| 59 'additional_input_paths': [], | 57 'additional_input_paths': [], |
| 60 'input_jars_paths': [], | 58 'input_jars_paths': [], |
| 61 'library_dexed_jars_paths': [], | 59 'library_dexed_jars_paths': [], |
| 62 'additional_src_dirs': [], | 60 'additional_src_dirs': [], |
| 63 'generated_src_dirs': [], | 61 'generated_src_dirs': [], |
| 64 'app_manifest_version_name%': '<(android_app_version_name)', | 62 'app_manifest_version_name%': '<(android_app_version_name)', |
| 65 'app_manifest_version_code%': '<(android_app_version_code)', | 63 'app_manifest_version_code%': '<(android_app_version_code)', |
| 66 'proguard_enabled%': 'false', | 64 'proguard_enabled%': 'false', |
| 67 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], | 65 'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'], |
| 68 'jar_name': 'chromium_apk_<(_target_name).jar', | 66 'jar_name': 'chromium_apk_<(_target_name).jar', |
| 69 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', | 67 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', |
| 70 'R_package%':'', | 68 'R_package%':'', |
| 71 'additional_R_text_files': [], | 69 'additional_R_text_files': [], |
| 72 'additional_res_dirs': [], | 70 'additional_res_dirs': [], |
| 73 'additional_res_packages': [], | 71 'additional_res_packages': [], |
| 74 'is_test_apk%': 0, | 72 'is_test_apk%': 0, |
| 75 'java_strings_grd%': '', | 73 'java_strings_grd%': '', |
| 76 'library_manifest_paths' : [], | |
| 77 'resource_input_paths': [], | 74 'resource_input_paths': [], |
| 78 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', | 75 'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)', |
| 79 'asset_location%': '<(intermediate_dir)/assets', | 76 'asset_location%': '<(intermediate_dir)/assets', |
| 80 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', | 77 'codegen_stamp': '<(intermediate_dir)/codegen.stamp', |
| 81 'compile_input_paths': [], | 78 'compile_input_paths': [], |
| 82 'package_input_paths': [], | 79 'package_input_paths': [], |
| 83 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', | 80 'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json', |
| 84 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLib
raries.template', | 81 'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLib
raries.template', |
| 85 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', | 82 'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/', |
| 86 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.
java', | 83 'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.
java', |
| (...skipping 15 matching lines...) Expand all Loading... |
| 102 'javac_includes': [], | 99 'javac_includes': [], |
| 103 'jar_excluded_classes': [], | 100 'jar_excluded_classes': [], |
| 104 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', | 101 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', |
| 105 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', | 102 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', |
| 106 'dex_path': '<(intermediate_dir)/classes.dex', | 103 'dex_path': '<(intermediate_dir)/classes.dex', |
| 107 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', | 104 'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar', |
| 108 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', | 105 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', |
| 109 'push_stamp': '<(intermediate_dir)/push.stamp', | 106 'push_stamp': '<(intermediate_dir)/push.stamp', |
| 110 'link_stamp': '<(intermediate_dir)/link.stamp', | 107 'link_stamp': '<(intermediate_dir)/link.stamp', |
| 111 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', | 108 'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp', |
| 112 'codegen_input_paths': [], | |
| 113 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', | 109 'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk', |
| 114 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', | 110 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', |
| 115 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', | 111 'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk', |
| 116 'source_dir': '<(java_in_dir)/src', | 112 'source_dir': '<(java_in_dir)/src', |
| 117 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', | 113 'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp', |
| 118 'device_intermediate_dir': '/data/local/tmp/chromium/<(_target_name)/<(CONFI
GURATION_NAME)', | 114 'device_intermediate_dir': '/data/local/tmp/chromium/<(_target_name)/<(CONFI
GURATION_NAME)', |
| 119 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', | 115 'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh', |
| 120 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', | 116 'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh
', |
| 121 'create_standalone_apk%': 1, | 117 'create_standalone_apk%': 1, |
| 122 'variables': { | 118 'variables': { |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 'additional_res_packages=': [], | 472 'additional_res_packages=': [], |
| 477 } | 473 } |
| 478 }], | 474 }], |
| 479 ], | 475 ], |
| 480 'inputs': [ | 476 'inputs': [ |
| 481 '<(DEPTH)/build/android/ant/apk-codegen.xml', | 477 '<(DEPTH)/build/android/ant/apk-codegen.xml', |
| 482 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 478 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 483 '<(DEPTH)/build/android/gyp/ant.py', | 479 '<(DEPTH)/build/android/gyp/ant.py', |
| 484 '<(android_manifest_path)', | 480 '<(android_manifest_path)', |
| 485 '>@(additional_input_paths)', | 481 '>@(additional_input_paths)', |
| 486 '>@(codegen_input_paths)', | |
| 487 '>@(library_manifest_paths)', | |
| 488 '>@(resource_input_paths)', | 482 '>@(resource_input_paths)', |
| 489 ], | 483 ], |
| 490 'outputs': [ | 484 'outputs': [ |
| 491 '<(codegen_stamp)', | 485 '<(codegen_stamp)', |
| 492 ], | 486 ], |
| 493 'action': [ | 487 'action': [ |
| 494 'python', '<(DEPTH)/build/android/gyp/ant.py', | 488 'python', '<(DEPTH)/build/android/gyp/ant.py', |
| 495 '-quiet', | 489 '-quiet', |
| 496 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', | 490 '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', |
| 497 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', | 491 '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', |
| 498 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', | 492 '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', |
| 499 '-DANDROID_MANIFEST=<(android_manifest_path)', | 493 '-DANDROID_MANIFEST=<(android_manifest_path)', |
| 500 '-DANDROID_SDK_JAR=<(android_sdk_jar)', | 494 '-DANDROID_SDK_JAR=<(android_sdk_jar)', |
| 501 '-DANDROID_SDK_ROOT=<(android_sdk_root)', | 495 '-DANDROID_SDK_ROOT=<(android_sdk_root)', |
| 502 '-DANDROID_SDK_VERSION=<(android_sdk_version)', | 496 '-DANDROID_SDK_VERSION=<(android_sdk_version)', |
| 503 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', | 497 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', |
| 504 '-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)', | |
| 505 '-DOUT_DIR=<(intermediate_dir)', | 498 '-DOUT_DIR=<(intermediate_dir)', |
| 506 '-DRESOURCE_DIR=<(resource_dir)', | 499 '-DRESOURCE_DIR=<(resource_dir)', |
| 507 | 500 |
| 508 '-DSTAMP=<(codegen_stamp)', | 501 '-DSTAMP=<(codegen_stamp)', |
| 509 '-Dbasedir=.', | 502 '-Dbasedir=.', |
| 510 '-buildfile', | 503 '-buildfile', |
| 511 '<(DEPTH)/build/android/ant/apk-codegen.xml', | 504 '<(DEPTH)/build/android/ant/apk-codegen.xml', |
| 512 | 505 |
| 513 # Add list of inputs to the command line, so if inputs change | 506 # Add list of inputs to the command line, so if inputs change |
| 514 # (e.g. if a Java file is removed), the command will be re-run. | 507 # (e.g. if a Java file is removed), the command will be re-run. |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 684 { | 677 { |
| 685 'action_name': 'ant package resources', | 678 'action_name': 'ant package resources', |
| 686 'message': 'Packaging resources for <(_target_name) APK', | 679 'message': 'Packaging resources for <(_target_name) APK', |
| 687 'inputs': [ | 680 'inputs': [ |
| 688 '<(DEPTH)/build/android/ant/apk-package-resources.xml', | 681 '<(DEPTH)/build/android/ant/apk-package-resources.xml', |
| 689 '<(DEPTH)/build/android/gyp/util/build_utils.py', | 682 '<(DEPTH)/build/android/gyp/util/build_utils.py', |
| 690 '<(DEPTH)/build/android/gyp/ant.py', | 683 '<(DEPTH)/build/android/gyp/ant.py', |
| 691 '<(android_manifest_path)', | 684 '<(android_manifest_path)', |
| 692 '<(codegen_stamp)', | 685 '<(codegen_stamp)', |
| 693 | 686 |
| 694 '>@(library_manifest_paths)', | |
| 695 '>@(additional_input_paths)', | 687 '>@(additional_input_paths)', |
| 696 ], | 688 ], |
| 697 'conditions': [ | 689 'conditions': [ |
| 698 ['is_test_apk == 1', { | 690 ['is_test_apk == 1', { |
| 699 'variables': { | 691 'variables': { |
| 700 'additional_res_dirs=': [], | 692 'additional_res_dirs=': [], |
| 701 'additional_res_packages=': [], | 693 'additional_res_packages=': [], |
| 702 } | 694 } |
| 703 }], | 695 }], |
| 704 ], | 696 ], |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 '<(DEPTH)/build/android/ant/apk-package.xml', | 761 '<(DEPTH)/build/android/ant/apk-package.xml', |
| 770 | 762 |
| 771 # Add list of inputs to the command line, so if inputs change | 763 # Add list of inputs to the command line, so if inputs change |
| 772 # (e.g. if a Java file is removed), the command will be re-run. | 764 # (e.g. if a Java file is removed), the command will be re-run. |
| 773 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. | 765 # TODO(newt): remove this once crbug.com/177552 is fixed in ninja. |
| 774 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', | 766 '-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)', |
| 775 ] | 767 ] |
| 776 }, | 768 }, |
| 777 ], | 769 ], |
| 778 } | 770 } |
| OLD | NEW |