2012-09-19 08:16:27 +04:00
|
|
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
# This file is meant to be included into a target to provide a rule
|
|
|
|
# to build Android APKs in a consistent manner.
|
|
|
|
#
|
|
|
|
# To use this, create a gyp target with the following form:
|
|
|
|
# {
|
|
|
|
# 'target_name': 'my_package_apk',
|
|
|
|
# 'type': 'none',
|
|
|
|
# 'variables': {
|
|
|
|
# 'apk_name': 'MyPackage',
|
|
|
|
# 'java_in_dir': 'path/to/package/root',
|
2013-03-26 21:35:21 +04:00
|
|
|
# 'resource_dir': 'path/to/package/root/res',
|
2012-09-19 08:16:27 +04:00
|
|
|
# },
|
|
|
|
# 'includes': ['path/to/this/gypi/file'],
|
|
|
|
# }
|
|
|
|
#
|
2012-09-28 22:22:29 +04:00
|
|
|
# Required variables:
|
2012-10-19 01:52:16 +04:00
|
|
|
# apk_name - The final apk will be named <apk_name>.apk
|
2012-09-28 22:22:29 +04:00
|
|
|
# java_in_dir - The top-level java directory. The src should be in
|
2013-02-21 02:39:17 +04:00
|
|
|
# <(java_in_dir)/src.
|
2012-09-28 22:22:29 +04:00
|
|
|
# Optional/automatic variables:
|
|
|
|
# additional_input_paths - These paths will be included in the 'inputs' list to
|
|
|
|
# ensure that this target is rebuilt when one of these paths changes.
|
2012-11-17 00:39:20 +04:00
|
|
|
# additional_res_dirs - Additional directories containing Android resources.
|
|
|
|
# additional_res_packages - Package names of the R.java files corresponding to
|
|
|
|
# each directory in additional_res_dirs.
|
2012-09-28 22:22:29 +04:00
|
|
|
# additional_src_dirs - Additional directories with .java files to be compiled
|
|
|
|
# and included in the output of this target.
|
2013-03-26 21:35:21 +04:00
|
|
|
# asset_location - The directory where assets are located.
|
2012-09-28 22:22:29 +04:00
|
|
|
# generated_src_dirs - Same as additional_src_dirs except used for .java files
|
|
|
|
# that are generated at build time. This should be set automatically by a
|
|
|
|
# target's dependencies. The .java files in these directories are not
|
|
|
|
# included in the 'inputs' list (unlike additional_src_dirs).
|
|
|
|
# input_jars_paths - The path to jars to be included in the classpath. This
|
|
|
|
# should be filled automatically by depending on the appropriate targets.
|
2012-11-17 00:39:20 +04:00
|
|
|
# is_test_apk - Set to 1 if building a test apk. This prevents resources from
|
|
|
|
# dependencies from being re-included.
|
2013-04-04 13:15:59 +04:00
|
|
|
# native_lib_target - The target_name of the target which generates the final
|
|
|
|
# shared library to be included in this apk. A stripped copy of the
|
|
|
|
# library will be included in the apk.
|
2012-10-17 23:07:14 +04:00
|
|
|
# resource_dir - The directory for resources.
|
2012-11-20 06:17:23 +04:00
|
|
|
# R_package - A custom Java package to generate the resource file R.java in.
|
|
|
|
# By default, the package given in AndroidManifest.xml will be used.
|
2013-01-16 21:54:42 +04:00
|
|
|
# java_strings_grd - The name of the grd file from which to generate localized
|
|
|
|
# strings.xml files, if any.
|
2013-03-20 01:40:39 +04:00
|
|
|
# library_manifest_paths'- Paths to additional AndroidManifest.xml files from
|
|
|
|
# libraries.
|
2012-09-19 08:16:27 +04:00
|
|
|
|
|
|
|
{
|
|
|
|
'variables': {
|
2012-10-05 20:51:32 +04:00
|
|
|
'additional_input_paths': [],
|
2012-09-19 08:16:27 +04:00
|
|
|
'input_jars_paths': [],
|
2013-03-28 03:31:27 +04:00
|
|
|
'library_dexed_jars_paths': [],
|
2012-09-28 22:22:29 +04:00
|
|
|
'additional_src_dirs': [],
|
|
|
|
'generated_src_dirs': [],
|
2012-10-10 05:29:46 +04:00
|
|
|
'app_manifest_version_name%': '<(android_app_version_name)',
|
|
|
|
'app_manifest_version_code%': '<(android_app_version_code)',
|
|
|
|
'proguard_enabled%': 'false',
|
2013-04-02 13:10:54 +04:00
|
|
|
'proguard_flags_paths%': ['<(DEPTH)/build/android/empty_proguard.flags'],
|
2013-04-04 13:15:59 +04:00
|
|
|
'native_lib_target%': '',
|
2013-03-27 00:44:29 +04:00
|
|
|
'jar_name': 'chromium_apk_<(_target_name).jar',
|
2013-03-26 21:35:21 +04:00
|
|
|
'resource_dir%':'<(DEPTH)/build/android/ant/empty/res',
|
2012-11-20 06:17:23 +04:00
|
|
|
'R_package%':'',
|
2013-04-06 04:14:39 +04:00
|
|
|
'additional_R_text_files': [],
|
2012-11-17 00:39:20 +04:00
|
|
|
'additional_res_dirs': [],
|
|
|
|
'additional_res_packages': [],
|
|
|
|
'is_test_apk%': 0,
|
2013-01-16 21:54:42 +04:00
|
|
|
'java_strings_grd%': '',
|
2013-03-26 21:35:21 +04:00
|
|
|
'library_manifest_paths' : [],
|
|
|
|
'resource_input_paths': [],
|
|
|
|
'intermediate_dir': '<(PRODUCT_DIR)/<(_target_name)',
|
|
|
|
'asset_location%': '<(intermediate_dir)/assets',
|
|
|
|
'codegen_stamp': '<(intermediate_dir)/codegen.stamp',
|
2013-04-03 00:36:13 +04:00
|
|
|
'compile_input_paths': [],
|
|
|
|
'package_input_paths': [],
|
2013-04-02 03:12:33 +04:00
|
|
|
'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
|
|
|
|
# TODO(cjhopman): build/ shouldn't refer to content/. The libraryloader and
|
|
|
|
# nativelibraries template should be moved out of content/ (to base/?).
|
|
|
|
# http://crbug.com/225101
|
|
|
|
'native_libraries_template': '<(DEPTH)/content/public/android/java/templates/NativeLibraries.template',
|
|
|
|
'native_libraries_java_dir': '<(intermediate_dir)/native_libraries_java/',
|
|
|
|
'native_libraries_java_file': '<(native_libraries_java_dir)/NativeLibraries.java',
|
|
|
|
'native_libraries_java_stamp': '<(intermediate_dir)/native_libraries_java.stamp',
|
|
|
|
'native_libraries_template_data_dir': '<(intermediate_dir)/native_libraries/',
|
|
|
|
'native_libraries_template_data_file': '<(native_libraries_template_data_dir)/native_libraries_array.h',
|
|
|
|
'native_libraries_template_data_stamp': '<(intermediate_dir)/native_libraries_template_data.stamp',
|
2013-03-26 21:35:21 +04:00
|
|
|
'compile_stamp': '<(intermediate_dir)/compile.stamp',
|
2013-03-27 00:44:29 +04:00
|
|
|
'jar_stamp': '<(intermediate_dir)/jar.stamp',
|
|
|
|
'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
|
2013-04-02 07:23:14 +04:00
|
|
|
'strip_stamp': '<(intermediate_dir)/strip.stamp',
|
2013-03-27 00:44:29 +04:00
|
|
|
'classes_dir': '<(intermediate_dir)/classes',
|
|
|
|
'javac_includes': [],
|
|
|
|
'jar_excluded_classes': [],
|
|
|
|
'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
|
|
|
|
'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar',
|
|
|
|
'dex_path': '<(intermediate_dir)/classes.dex',
|
2013-04-06 04:14:39 +04:00
|
|
|
'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml',
|
2013-04-03 00:36:13 +04:00
|
|
|
'push_stamp': '<(intermediate_dir)/push.stamp',
|
|
|
|
'link_stamp': '<(intermediate_dir)/link.stamp',
|
2013-03-26 21:35:21 +04:00
|
|
|
'codegen_input_paths': [],
|
2013-04-10 02:22:15 +04:00
|
|
|
'keystore_path': '<(DEPTH)/build/android/ant/chromium-debug.keystore',
|
|
|
|
'unsigned_apk_path': '<(intermediate_dir)/<(apk_name)-unsigned.apk',
|
2013-04-06 04:14:39 +04:00
|
|
|
'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk',
|
|
|
|
'source_dir': '<(java_in_dir)/src',
|
2013-04-02 20:55:46 +04:00
|
|
|
'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp',
|
2013-04-05 23:55:07 +04:00
|
|
|
'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
|
2012-09-19 08:16:27 +04:00
|
|
|
},
|
2012-11-16 11:31:49 +04:00
|
|
|
# Pass the jar path to the apk's "fake" jar target. This would be better as
|
|
|
|
# direct_dependent_settings, but a variable set by a direct_dependent_settings
|
|
|
|
# cannot be lifted in a dependent to all_dependent_settings.
|
|
|
|
'all_dependent_settings': {
|
|
|
|
'variables': {
|
|
|
|
'apk_output_jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)',
|
|
|
|
},
|
|
|
|
},
|
2013-01-16 21:54:42 +04:00
|
|
|
'conditions': [
|
2013-03-26 21:35:21 +04:00
|
|
|
['resource_dir!=""', {
|
|
|
|
'variables': {
|
|
|
|
'resource_input_paths': [ '<!@(find <(resource_dir) -name "*")' ]
|
|
|
|
},
|
|
|
|
}],
|
2013-01-16 21:54:42 +04:00
|
|
|
['R_package != ""', {
|
|
|
|
'variables': {
|
|
|
|
# We generate R.java in package R_package (in addition to the package
|
|
|
|
# listed in the AndroidManifest.xml, which is unavoidable).
|
|
|
|
'additional_res_dirs': ['<(DEPTH)/build/android/ant/empty/res'],
|
|
|
|
'additional_res_packages': ['<(R_package)'],
|
|
|
|
'additional_R_text_files': ['<(PRODUCT_DIR)/<(package_name)/R.txt'],
|
|
|
|
},
|
|
|
|
}],
|
2013-04-04 13:15:59 +04:00
|
|
|
['native_lib_target != "" and component == "shared_library"', {
|
2013-04-03 22:20:22 +04:00
|
|
|
'dependencies': [
|
|
|
|
'<(DEPTH)/build/android/setup.gyp:copy_system_libraries',
|
|
|
|
]
|
|
|
|
}],
|
2013-04-04 13:15:59 +04:00
|
|
|
['native_lib_target != ""', {
|
2013-04-02 03:12:33 +04:00
|
|
|
'variables': {
|
|
|
|
'compile_input_paths': [ '<(native_libraries_java_stamp)' ],
|
|
|
|
'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
|
2013-04-04 13:15:59 +04:00
|
|
|
'native_libs_paths': ['<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'],
|
2013-04-02 03:12:33 +04:00
|
|
|
},
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'ordered_libraries_<(_target_name)',
|
|
|
|
'message': 'Writing dependency ordered libraries for <(_target_name).',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-03 22:20:22 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/write_ordered_libraries.py',
|
2013-04-02 03:12:33 +04:00
|
|
|
'<@(native_libs_paths)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(ordered_libraries_file)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-03 22:20:22 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/write_ordered_libraries.py',
|
2013-04-02 03:12:33 +04:00
|
|
|
'--input-libraries=<(native_libs_paths)',
|
2013-04-03 22:20:22 +04:00
|
|
|
'--readelf=<(android_readelf)',
|
2013-04-02 03:12:33 +04:00
|
|
|
'--output=<(ordered_libraries_file)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'native_libraries_template_data_<(_target_name)',
|
|
|
|
'message': 'Creating native_libraries_list.h for <(_target_name).',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
|
2013-04-02 03:12:33 +04:00
|
|
|
'<(ordered_libraries_file)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(native_libraries_template_data_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/create_native_libraries_header.py',
|
2013-04-02 03:12:33 +04:00
|
|
|
'--ordered-libraries=<(ordered_libraries_file)',
|
|
|
|
'--output=<(native_libraries_template_data_file)',
|
|
|
|
'--stamp=<(native_libraries_template_data_stamp)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'native_libraries_<(_target_name)',
|
|
|
|
'message': 'Creating NativeLibraries.java for <(_target_name).',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/gcc_preprocess.py',
|
2013-04-02 03:12:33 +04:00
|
|
|
'<(native_libraries_template_data_stamp)',
|
|
|
|
'<(native_libraries_template)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(native_libraries_java_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/gcc_preprocess.py',
|
2013-04-02 03:12:33 +04:00
|
|
|
'--include-path=<(native_libraries_template_data_dir)',
|
|
|
|
'--output=<(native_libraries_java_file)',
|
|
|
|
'--template=<(native_libraries_template)',
|
|
|
|
'--stamp=<(native_libraries_java_stamp)',
|
|
|
|
],
|
|
|
|
},
|
2013-04-02 07:23:14 +04:00
|
|
|
{
|
|
|
|
'action_name': 'strip_native_libraries',
|
|
|
|
'message': 'Stripping libraries for <(_target_name)',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/strip_library_for_apk.py',
|
2013-04-02 07:23:14 +04:00
|
|
|
'<(ordered_libraries_file)'
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(strip_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/strip_library_for_apk.py',
|
2013-04-02 07:23:14 +04:00
|
|
|
'--android-strip=<(android_strip)',
|
|
|
|
'--android-strip-arg=--strip-unneeded',
|
|
|
|
'--stripped-libraries-dir=<(apk_libraries_dir)',
|
|
|
|
'--libraries-dir=<(SHARED_LIB_DIR)',
|
|
|
|
'--libraries-file=<(ordered_libraries_file)',
|
|
|
|
'--stamp=<(strip_stamp)',
|
|
|
|
],
|
|
|
|
},
|
2013-04-02 03:12:33 +04:00
|
|
|
],
|
2013-04-03 00:36:13 +04:00
|
|
|
'conditions': [
|
|
|
|
['gyp_managed_install == 1', {
|
|
|
|
'variables': {
|
2013-04-05 23:55:07 +04:00
|
|
|
'apk_libraries_dir': '<(intermediate_dir)/lib.stripped/<(android_app_abi)',
|
|
|
|
'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
|
2013-04-03 00:36:13 +04:00
|
|
|
'device_library_dir': '/data/local/tmp/chromium/lib.stripped/<(_target_name)',
|
|
|
|
},
|
|
|
|
'dependencies': [
|
|
|
|
'<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
|
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'push_libraries_<(_target_name)',
|
|
|
|
'message': 'Pushing libraries to device for <(_target_name)',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-04 13:35:50 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/md5_check.py',
|
2013-04-03 00:36:13 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/push_libraries.py',
|
|
|
|
'<(strip_stamp)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(push_stamp)'
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/push_libraries.py',
|
|
|
|
'--libraries-dir=<(apk_libraries_dir)',
|
|
|
|
'--device-dir=<(device_library_dir)',
|
|
|
|
'--libraries-json=<(ordered_libraries_file)',
|
|
|
|
'--stamp=<(push_stamp)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'create_library_links',
|
|
|
|
'message': 'Creating links on device for <(_target_name).',
|
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/gyp/create_device_library_links.py',
|
|
|
|
'<(apk_install_stamp)',
|
|
|
|
'<(push_stamp)'
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(link_stamp)'
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
|
|
|
|
'--apk=<(final_apk_path)',
|
|
|
|
'--libraries-json=<(ordered_libraries_file)',
|
2013-04-05 07:51:51 +04:00
|
|
|
'--libraries-dir=<(apk_libraries_dir)',
|
2013-04-03 00:36:13 +04:00
|
|
|
'--target-dir=<(device_library_dir)',
|
|
|
|
'--stamp=<(link_stamp)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}, {
|
2013-04-05 07:41:57 +04:00
|
|
|
# gyp_managed_install != 1
|
2013-04-03 00:36:13 +04:00
|
|
|
'variables': {
|
2013-04-05 23:55:07 +04:00
|
|
|
'apk_libraries_dir': '<(apk_package_native_libs_dir)/<(android_app_abi)',
|
2013-04-03 00:36:13 +04:00
|
|
|
'package_input_paths': [ '<(strip_stamp)' ],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
2013-04-04 13:15:59 +04:00
|
|
|
}], # native_lib_target != ''
|
2013-01-16 21:54:42 +04:00
|
|
|
['java_strings_grd != ""', {
|
|
|
|
'variables': {
|
2013-03-26 11:31:57 +04:00
|
|
|
'res_grit_dir': '<(SHARED_INTERMEDIATE_DIR)/<(package_name)_apk/res_grit',
|
|
|
|
'additional_res_dirs': ['<(res_grit_dir)'],
|
2013-01-16 21:54:42 +04:00
|
|
|
# grit_grd_file is used by grit_action.gypi, included below.
|
|
|
|
'grit_grd_file': '<(java_in_dir)/strings/<(java_strings_grd)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'resource_input_paths': [
|
|
|
|
'<!@pymod_do_main(grit_info <@(grit_defines) --outputs "<(res_grit_dir)" <(grit_grd_file))'
|
|
|
|
],
|
2013-01-16 21:54:42 +04:00
|
|
|
},
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'generate_localized_strings_xml',
|
|
|
|
'variables': {
|
2013-03-26 11:31:57 +04:00
|
|
|
'grit_additional_defines': ['-E', 'ANDROID_JAVA_TAGGED_ONLY=false'],
|
|
|
|
'grit_out_dir': '<(res_grit_dir)',
|
2013-01-16 21:54:42 +04:00
|
|
|
# resource_ids is unneeded since we don't generate .h headers.
|
|
|
|
'grit_resource_ids': '',
|
|
|
|
},
|
|
|
|
'includes': ['../build/grit_action.gypi'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}],
|
2013-04-02 20:55:46 +04:00
|
|
|
['gyp_managed_install == 1', {
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'apk_install_<(_target_name)',
|
|
|
|
'message': 'Installing <(apk_name).apk',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-02 20:55:46 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/apk_install.py',
|
|
|
|
'<(final_apk_path)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(apk_install_stamp)'
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/apk_install.py',
|
|
|
|
'--android-sdk-tools=<(android_sdk_tools)',
|
|
|
|
'--apk-path=<(final_apk_path)',
|
|
|
|
'--stamp=<(apk_install_stamp)'
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}],
|
2013-01-16 21:54:42 +04:00
|
|
|
],
|
2012-09-19 08:16:27 +04:00
|
|
|
'actions': [
|
|
|
|
{
|
2013-03-26 21:35:21 +04:00
|
|
|
'action_name': 'ant_codegen_<(_target_name)',
|
|
|
|
'message': 'Generating R.java for <(_target_name)',
|
|
|
|
'conditions': [
|
|
|
|
['is_test_apk == 1', {
|
|
|
|
'variables': {
|
|
|
|
'additional_res_dirs=': [],
|
|
|
|
'additional_res_packages=': [],
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/ant/apk-codegen.xml',
|
2013-04-05 07:41:57 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/ant.py',
|
2013-04-06 04:14:39 +04:00
|
|
|
'<(android_manifest_path)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'>@(library_manifest_paths)'
|
|
|
|
'>@(codegen_input_paths)',
|
|
|
|
'>@(additional_input_paths)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(codegen_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-05 07:41:57 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/ant.py',
|
|
|
|
'-quiet',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
|
|
|
|
'-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
|
|
|
|
'-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
|
2013-04-06 04:14:39 +04:00
|
|
|
'-DANDROID_MANIFEST=<(android_manifest_path)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DANDROID_SDK_JAR=<(android_sdk_jar)',
|
|
|
|
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
|
|
|
|
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
|
|
|
|
'-DLIBRARY_MANIFEST_PATHS=>(library_manifest_paths)',
|
|
|
|
'-DOUT_DIR=<(intermediate_dir)',
|
|
|
|
'-DRESOURCE_DIR=<(resource_dir)',
|
|
|
|
|
|
|
|
'-DSTAMP=<(codegen_stamp)',
|
|
|
|
'-Dbasedir=.',
|
|
|
|
'-buildfile',
|
|
|
|
'<(DEPTH)/build/android/ant/apk-codegen.xml',
|
|
|
|
|
|
|
|
# Add list of inputs to the command line, so if inputs change
|
|
|
|
# (e.g. if a Java file is removed), the command will be re-run.
|
|
|
|
# TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
|
|
|
|
'-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
2013-03-27 00:44:29 +04:00
|
|
|
'action_name': 'javac_<(_target_name)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'message': 'Compiling java for <(_target_name)',
|
2013-03-27 00:44:29 +04:00
|
|
|
'variables': {
|
|
|
|
'all_src_dirs': [
|
|
|
|
'<(java_in_dir)/src',
|
|
|
|
'<(intermediate_dir)/gen',
|
|
|
|
'>@(additional_src_dirs)',
|
|
|
|
'>@(generated_src_dirs)',
|
|
|
|
],
|
|
|
|
},
|
2012-09-19 08:16:27 +04:00
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-04 13:35:50 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/javac.py',
|
2012-10-12 03:23:49 +04:00
|
|
|
# If there is a separate find for additional_src_dirs, it will find the
|
2012-09-28 22:22:29 +04:00
|
|
|
# wrong .java files when additional_src_dirs is empty.
|
|
|
|
'>!@(find >(java_in_dir) >(additional_src_dirs) -name "*.java")',
|
2012-09-19 08:16:27 +04:00
|
|
|
'>@(input_jars_paths)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'<(codegen_stamp)',
|
2013-04-02 03:12:33 +04:00
|
|
|
'>@(compile_input_paths)',
|
2013-03-26 21:35:21 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(compile_stamp)',
|
|
|
|
],
|
2013-03-27 00:44:29 +04:00
|
|
|
'action': [
|
2013-04-04 13:35:50 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/javac.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'--output-dir=<(classes_dir)',
|
|
|
|
'--classpath=>(input_jars_paths) <(android_sdk_jar)',
|
|
|
|
'--src-dirs=>(all_src_dirs)',
|
|
|
|
'--javac-includes=<(javac_includes)',
|
2013-04-02 03:52:40 +04:00
|
|
|
'--chromium-code=<(chromium_code)',
|
2013-03-27 00:44:29 +04:00
|
|
|
'--stamp=<(compile_stamp)',
|
|
|
|
|
|
|
|
# TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
|
|
|
|
'--ignore=>!(echo \'>(_inputs)\' | md5sum)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'jar_<(_target_name)',
|
|
|
|
'message': 'Creating <(_target_name) jar',
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-04 13:35:50 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/md5_check.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/jar.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(compile_stamp)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(jar_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-04 13:35:50 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/jar.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'--classes-dir=<(classes_dir)',
|
|
|
|
'--jar-path=<(jar_path)',
|
|
|
|
'--excluded-classes=<(jar_excluded_classes)',
|
|
|
|
'--stamp=<(jar_stamp)',
|
|
|
|
|
|
|
|
# TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
|
|
|
|
'--ignore=>!(echo \'>(_inputs)\' | md5sum)',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'ant_obfuscate_<(_target_name)',
|
|
|
|
'message': 'Obfuscating <(_target_name)',
|
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/ant/apk-obfuscate.xml',
|
|
|
|
'<(DEPTH)/build/android/ant/create-test-jar.js',
|
2013-04-05 07:41:57 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/ant.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(compile_stamp)',
|
2013-04-02 13:10:54 +04:00
|
|
|
'>@(proguard_flags_paths)',
|
2013-03-27 00:44:29 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(obfuscate_stamp)',
|
|
|
|
],
|
2013-03-26 21:35:21 +04:00
|
|
|
'action': [
|
2013-04-05 07:41:57 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/ant.py',
|
|
|
|
'-quiet',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DADDITIONAL_SRC_DIRS=>(additional_src_dirs)',
|
|
|
|
'-DANDROID_SDK_JAR=<(android_sdk_jar)',
|
|
|
|
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
|
|
|
|
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
|
|
|
|
'-DAPK_NAME=<(apk_name)',
|
|
|
|
'-DCREATE_TEST_JAR_PATH=<(DEPTH)/build/android/ant/create-test-jar.js',
|
2013-03-27 13:04:27 +04:00
|
|
|
'-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DGENERATED_SRC_DIRS=>(generated_src_dirs)',
|
|
|
|
'-DINPUT_JARS_PATHS=>(input_jars_paths)',
|
|
|
|
'-DIS_TEST_APK=<(is_test_apk)',
|
|
|
|
'-DJAR_PATH=<(PRODUCT_DIR)/lib.java/<(jar_name)',
|
2013-03-27 00:44:29 +04:00
|
|
|
'-DOBFUSCATED_JAR_PATH=<(obfuscated_jar_path)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DOUT_DIR=<(intermediate_dir)',
|
|
|
|
'-DPROGUARD_ENABLED=<(proguard_enabled)',
|
2013-04-02 13:10:54 +04:00
|
|
|
'-DPROGUARD_FLAGS=<(proguard_flags_paths)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DTEST_JAR_PATH=<(PRODUCT_DIR)/test.lib.java/<(apk_name).jar',
|
|
|
|
|
2013-03-27 00:44:29 +04:00
|
|
|
'-DSTAMP=<(obfuscate_stamp)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-Dbasedir=.',
|
|
|
|
'-buildfile',
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(DEPTH)/build/android/ant/apk-obfuscate.xml',
|
2013-03-26 21:35:21 +04:00
|
|
|
|
|
|
|
# Add list of inputs to the command line, so if inputs change
|
|
|
|
# (e.g. if a Java file is removed), the command will be re-run.
|
|
|
|
# TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
|
|
|
|
'-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
|
|
|
|
],
|
|
|
|
},
|
2013-03-27 00:44:29 +04:00
|
|
|
{
|
|
|
|
'action_name': 'dex_<(_target_name)',
|
|
|
|
'message': 'Dexing <(_target_name) jar',
|
|
|
|
'variables': {
|
|
|
|
'conditions': [
|
2013-03-29 20:12:42 +04:00
|
|
|
['proguard_enabled=="true" and CONFIGURATION_NAME=="Release"', {
|
2013-03-27 00:44:29 +04:00
|
|
|
'dex_inputs': [ '<(obfuscated_jar_path)' ],
|
|
|
|
'dex_generated_inputs': [],
|
|
|
|
}, {
|
|
|
|
'dex_inputs': [
|
2013-03-28 03:31:27 +04:00
|
|
|
'>@(library_dexed_jars_paths)',
|
2013-03-27 00:44:29 +04:00
|
|
|
],
|
|
|
|
'dex_generated_inputs': [
|
|
|
|
'<(classes_dir)',
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
},
|
|
|
|
'inputs': [
|
2013-04-05 03:04:40 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-04 13:35:50 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/md5_check.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/dex.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(compile_stamp)',
|
|
|
|
'>@(dex_inputs)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(dex_path)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-04 13:35:50 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/dex.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'--dex-path=<(dex_path)',
|
|
|
|
'--android-sdk-root=<(android_sdk_root)',
|
|
|
|
|
|
|
|
# TODO(newt): remove this once http://crbug.com/177552 is fixed in ninja.
|
2013-03-27 16:25:00 +04:00
|
|
|
'--ignore=>!(echo \'>(_inputs)\' | md5sum)',
|
2013-03-27 00:44:29 +04:00
|
|
|
|
|
|
|
'>@(dex_inputs)',
|
|
|
|
'>@(dex_generated_inputs)',
|
|
|
|
]
|
|
|
|
},
|
2013-03-26 21:35:21 +04:00
|
|
|
{
|
|
|
|
'action_name': 'ant_package_<(_target_name)',
|
|
|
|
'message': 'Packaging <(_target_name).',
|
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/ant/apk-package.xml',
|
2013-04-05 07:41:57 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/ant.py',
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(dex_path)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'<(codegen_stamp)',
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(obfuscate_stamp)',
|
2013-04-02 07:23:14 +04:00
|
|
|
'>@(package_input_paths)',
|
2012-09-19 08:16:27 +04:00
|
|
|
],
|
2012-10-17 23:07:14 +04:00
|
|
|
'conditions': [
|
2012-11-17 00:39:20 +04:00
|
|
|
['is_test_apk == 1', {
|
|
|
|
'variables': {
|
|
|
|
'additional_res_dirs=': [],
|
|
|
|
'additional_res_packages=': [],
|
|
|
|
}
|
|
|
|
}],
|
2012-10-17 23:07:14 +04:00
|
|
|
],
|
2012-09-19 08:16:27 +04:00
|
|
|
'outputs': [
|
2013-04-10 02:22:15 +04:00
|
|
|
'<(unsigned_apk_path)',
|
2012-09-19 08:16:27 +04:00
|
|
|
],
|
|
|
|
'action': [
|
2013-04-05 07:41:57 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/ant.py',
|
|
|
|
'-quiet',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DADDITIONAL_RES_DIRS=>(additional_res_dirs)',
|
|
|
|
'-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)',
|
|
|
|
'-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)',
|
|
|
|
'-DANDROID_SDK_JAR=<(android_sdk_jar)',
|
2012-09-19 08:16:27 +04:00
|
|
|
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
|
|
|
|
'-DANDROID_SDK_VERSION=<(android_sdk_version)',
|
2012-10-05 20:51:32 +04:00
|
|
|
'-DAPK_NAME=<(apk_name)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)',
|
|
|
|
'-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)',
|
2012-10-05 20:51:32 +04:00
|
|
|
'-DASSET_DIR=<(asset_location)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
|
2013-04-05 23:55:07 +04:00
|
|
|
'-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DOUT_DIR=<(intermediate_dir)',
|
2012-09-19 08:16:27 +04:00
|
|
|
'-DRESOURCE_DIR=<(resource_dir)',
|
2013-04-06 04:14:39 +04:00
|
|
|
'-DSOURCE_DIR=<(source_dir)',
|
2013-04-10 02:22:15 +04:00
|
|
|
'-DUNSIGNED_APK_PATH=<(unsigned_apk_path)',
|
2013-03-26 21:35:21 +04:00
|
|
|
|
|
|
|
'-Dbasedir=.',
|
|
|
|
'-buildfile',
|
|
|
|
'<(DEPTH)/build/android/ant/apk-package.xml',
|
2012-09-28 22:22:29 +04:00
|
|
|
|
2013-03-06 04:36:41 +04:00
|
|
|
# Add list of inputs to the command line, so if inputs change
|
|
|
|
# (e.g. if a Java file is removed), the command will be re-run.
|
|
|
|
# TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DTHIS_IS_IGNORED=>!(echo \'>(_inputs)\' | md5sum)',
|
2012-09-19 08:16:27 +04:00
|
|
|
]
|
|
|
|
},
|
2013-04-10 02:22:15 +04:00
|
|
|
{
|
|
|
|
'action_name': 'finalize_apk',
|
|
|
|
'message': 'Signing/aligning <(_target_name) APK.',
|
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/finalize_apk.py',
|
|
|
|
'<(unsigned_apk_path)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(final_apk_path)',
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/finalize_apk.py',
|
|
|
|
'--android-sdk-root=<(android_sdk_root)',
|
|
|
|
'--unsigned-apk-path=<(unsigned_apk_path)',
|
|
|
|
'--final-apk-path=<(final_apk_path)',
|
|
|
|
'--keystore-path=<(keystore_path)',
|
|
|
|
|
|
|
|
# TODO(newt): remove this once crbug.com/177552 is fixed in ninja.
|
|
|
|
'--ignore=>!(echo \'>(_inputs)\' | md5sum)',
|
|
|
|
],
|
|
|
|
},
|
2012-09-19 08:16:27 +04:00
|
|
|
],
|
|
|
|
}
|