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.
|
2014-02-10 20:19:22 +04:00
|
|
|
# use_chromium_linker - Enable the content dynamic linker that allows sharing the
|
2013-10-22 01:40:44 +04:00
|
|
|
# RELRO section of the native libraries between the different processes.
|
2014-02-10 20:19:22 +04:00
|
|
|
# enable_chromium_linker_tests - Enable the content dynamic linker test support
|
2013-10-22 01:40:44 +04:00
|
|
|
# code. This allows a test APK to inject a Linker.TestRunner instance at
|
2014-02-10 20:19:22 +04:00
|
|
|
# runtime. Should only be used by the chromium_linker_test_apk target!!
|
2013-12-11 07:02:10 +04:00
|
|
|
# never_lint - Set to 1 to not run lint on this target.
|
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)',
|
2014-05-27 09:42:45 +04:00
|
|
|
# aapt generates this proguard.txt.
|
|
|
|
'generated_proguard_file': '<(intermediate_dir)/proguard.txt',
|
2012-10-10 05:29:46 +04:00
|
|
|
'proguard_enabled%': 'false',
|
2014-05-27 09:42:45 +04:00
|
|
|
'proguard_flags_paths': ['<(generated_proguard_file)'],
|
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-03-26 21:35:21 +04:00
|
|
|
'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
|
|
|
'package_input_paths': [],
|
2013-04-02 03:12:33 +04:00
|
|
|
'ordered_libraries_file': '<(intermediate_dir)/native_libraries.json',
|
2014-02-10 20:19:22 +04:00
|
|
|
'native_libraries_template': '<(DEPTH)/base/android/java/templates/NativeLibraries.template',
|
2013-04-02 03:12:33 +04:00
|
|
|
'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',
|
2013-11-28 18:28:52 +04:00
|
|
|
'native_libraries_template_version_file': '<(native_libraries_template_data_dir)/native_libraries_version.h',
|
2013-03-26 21:35:21 +04:00
|
|
|
'compile_stamp': '<(intermediate_dir)/compile.stamp',
|
2013-12-11 07:02:10 +04:00
|
|
|
'lint_stamp': '<(intermediate_dir)/lint.stamp',
|
|
|
|
'lint_result': '<(intermediate_dir)/lint_result.xml',
|
|
|
|
'lint_config': '<(intermediate_dir)/lint_config.xml',
|
|
|
|
'never_lint%': 0,
|
2013-08-22 04:08:31 +04:00
|
|
|
'instr_stamp': '<(intermediate_dir)/instr.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',
|
2013-08-22 04:08:31 +04:00
|
|
|
'classes_final_dir': '<(intermediate_dir)/classes_instr',
|
2013-03-27 00:44:29 +04:00
|
|
|
'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-08-22 04:08:31 +04:00
|
|
|
'emma_device_jar': '<(android_sdk_root)/tools/lib/emma_device.jar',
|
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-04-11 03:10:17 +04:00
|
|
|
'package_resources_stamp': '<(intermediate_dir)/package_resources.stamp',
|
2014-05-28 23:50:08 +04:00
|
|
|
'crunch_output_dir': '<(intermediate_dir)/res',
|
|
|
|
'resource_packaged_apk_name': '<(apk_name)-resources.ap_',
|
|
|
|
'resource_packaged_apk_path': '<(intermediate_dir)/<(resource_packaged_apk_name)',
|
2013-04-10 02:22:15 +04:00
|
|
|
'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',
|
2013-06-25 22:42:07 +04:00
|
|
|
'incomplete_apk_path': '<(intermediate_dir)/<(apk_name)-incomplete.apk',
|
2013-04-19 13:16:13 +04:00
|
|
|
'apk_install_record': '<(intermediate_dir)/apk_install.record.stamp',
|
2014-05-21 08:03:14 +04:00
|
|
|
'device_intermediate_dir': '/data/data/org.chromium.gyp_managed_install/<(_target_name)/<(CONFIGURATION_NAME)',
|
2013-04-19 13:16:13 +04:00
|
|
|
'symlink_script_host_path': '<(intermediate_dir)/create_symlinks.sh',
|
2013-04-23 22:30:26 +04:00
|
|
|
'symlink_script_device_path': '<(device_intermediate_dir)/create_symlinks.sh',
|
2013-06-25 22:42:07 +04:00
|
|
|
'create_standalone_apk%': 1,
|
2013-04-24 23:31:22 +04:00
|
|
|
'variables': {
|
2013-06-25 22:42:07 +04:00
|
|
|
'variables': {
|
|
|
|
'native_lib_target%': '',
|
2013-11-28 18:28:52 +04:00
|
|
|
'native_lib_version_name%': '',
|
2014-02-10 20:19:22 +04:00
|
|
|
'use_chromium_linker%' : 0,
|
|
|
|
'enable_chromium_linker_tests%': 0,
|
2013-10-31 00:33:12 +04:00
|
|
|
'is_test_apk%': 0,
|
2013-06-25 22:42:07 +04:00
|
|
|
},
|
2013-04-24 23:31:22 +04:00
|
|
|
'conditions': [
|
2013-06-25 22:42:07 +04:00
|
|
|
['gyp_managed_install == 1 and native_lib_target != ""', {
|
|
|
|
'unsigned_standalone_apk_path': '<(intermediate_dir)/<(apk_name)-standalone-unsigned.apk',
|
|
|
|
}, {
|
|
|
|
'unsigned_standalone_apk_path': '<(unsigned_apk_path)',
|
|
|
|
}],
|
2013-04-24 23:31:22 +04:00
|
|
|
['gyp_managed_install == 1', {
|
|
|
|
'apk_package_native_libs_dir': '<(intermediate_dir)/libs.managed',
|
|
|
|
}, {
|
|
|
|
'apk_package_native_libs_dir': '<(intermediate_dir)/libs',
|
|
|
|
}],
|
2013-10-31 00:33:12 +04:00
|
|
|
['is_test_apk == 0 and emma_coverage != 0', {
|
2014-04-30 15:22:41 +04:00
|
|
|
'emma_instrument%': 1,
|
2013-10-31 00:33:12 +04:00
|
|
|
},{
|
2014-04-30 15:22:41 +04:00
|
|
|
'emma_instrument%': 0,
|
2013-10-31 00:33:12 +04:00
|
|
|
}],
|
2013-04-24 23:31:22 +04:00
|
|
|
],
|
|
|
|
},
|
2013-06-25 22:42:07 +04:00
|
|
|
'native_lib_target%': '',
|
2013-11-28 18:28:52 +04:00
|
|
|
'native_lib_version_name%': '',
|
2014-02-10 20:19:22 +04:00
|
|
|
'use_chromium_linker%' : 0,
|
|
|
|
'enable_chromium_linker_tests%': 0,
|
2014-04-30 15:22:41 +04:00
|
|
|
'emma_instrument%': '<(emma_instrument)',
|
2013-04-24 23:31:22 +04:00
|
|
|
'apk_package_native_libs_dir': '<(apk_package_native_libs_dir)',
|
2013-06-25 22:42:07 +04:00
|
|
|
'unsigned_standalone_apk_path': '<(unsigned_standalone_apk_path)',
|
2013-09-20 21:44:33 +04:00
|
|
|
'extra_native_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': {
|
2014-03-31 20:36:26 +04:00
|
|
|
'apk_output_jar_path': '<(jar_path)',
|
2012-11-16 11:31:49 +04:00
|
|
|
},
|
|
|
|
},
|
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-11 04:26:25 +04:00
|
|
|
],
|
2013-04-03 22:20:22 +04:00
|
|
|
}],
|
2014-02-11 23:59:20 +04:00
|
|
|
['use_chromium_linker == 1', {
|
2013-10-22 01:40:44 +04:00
|
|
|
'dependencies': [
|
2014-02-10 20:19:22 +04:00
|
|
|
'<(DEPTH)/base/base.gyp:chromium_android_linker',
|
2013-10-22 01:40:44 +04:00
|
|
|
],
|
|
|
|
}],
|
2013-04-04 13:15:59 +04:00
|
|
|
['native_lib_target != ""', {
|
2013-04-02 03:12:33 +04:00
|
|
|
'variables': {
|
|
|
|
'generated_src_dirs': [ '<(native_libraries_java_dir)' ],
|
2013-04-24 23:31:22 +04:00
|
|
|
'native_libs_paths': [
|
|
|
|
'<(SHARED_LIB_DIR)/<(native_lib_target).>(android_product_extension)'
|
|
|
|
],
|
|
|
|
'package_input_paths': [
|
2014-04-10 17:42:46 +04:00
|
|
|
'<(apk_package_native_libs_dir)/<(android_app_abi)/gdbserver',
|
2013-04-24 23:31:22 +04:00
|
|
|
],
|
2013-04-02 03:12:33 +04:00
|
|
|
},
|
2013-04-24 23:31:22 +04:00
|
|
|
'copies': [
|
|
|
|
{
|
|
|
|
# gdbserver is always copied into the APK's native libs dir. The ant
|
|
|
|
# build scripts (apkbuilder task) will only include it in a debug
|
|
|
|
# build.
|
|
|
|
'destination': '<(apk_package_native_libs_dir)/<(android_app_abi)',
|
|
|
|
'files': [
|
|
|
|
'<(android_gdbserver)',
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2013-04-02 03:12:33 +04:00
|
|
|
'actions': [
|
|
|
|
{
|
2013-04-18 11:23:26 +04:00
|
|
|
'variables': {
|
2013-10-22 01:40:44 +04:00
|
|
|
'conditions': [
|
2014-02-11 23:59:20 +04:00
|
|
|
['use_chromium_linker == 1', {
|
2013-10-22 01:40:44 +04:00
|
|
|
'variables': {
|
|
|
|
'linker_input_libraries': [
|
2014-02-10 20:19:22 +04:00
|
|
|
'<(SHARED_LIB_DIR)/libchromium_android_linker.>(android_product_extension)',
|
2013-10-22 01:40:44 +04:00
|
|
|
],
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
'variables': {
|
|
|
|
'linker_input_libraries': [],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
2013-09-20 21:44:33 +04:00
|
|
|
'input_libraries': [
|
|
|
|
'<@(native_libs_paths)',
|
|
|
|
'<@(extra_native_libs)',
|
2013-10-22 01:40:44 +04:00
|
|
|
'<@(linker_input_libraries)',
|
2013-09-20 21:44:33 +04:00
|
|
|
],
|
2013-04-18 11:23:26 +04:00
|
|
|
},
|
|
|
|
'includes': ['../build/android/write_ordered_libraries.gypi'],
|
2013-04-02 03:12:33 +04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'native_libraries_template_data_<(_target_name)',
|
2013-10-31 22:08:28 +04:00
|
|
|
'message': 'Creating native_libraries_list.h for <(_target_name)',
|
2013-04-02 03:12:33 +04:00
|
|
|
'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': [
|
2013-11-28 18:28:52 +04:00
|
|
|
'<(native_libraries_template_data_file)',
|
|
|
|
'<(native_libraries_template_version_file)',
|
2013-04-02 03:12:33 +04:00
|
|
|
],
|
|
|
|
'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)',
|
2013-11-28 18:28:52 +04:00
|
|
|
'--version-name=<(native_lib_version_name)',
|
|
|
|
'--native-library-list=<(native_libraries_template_data_file)',
|
|
|
|
'--version-output=<(native_libraries_template_version_file)',
|
2013-04-02 03:12:33 +04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'native_libraries_<(_target_name)',
|
2013-10-22 01:40:44 +04:00
|
|
|
'variables': {
|
|
|
|
'conditions': [
|
2014-02-11 23:59:20 +04:00
|
|
|
['use_chromium_linker == 1', {
|
2013-10-22 01:40:44 +04:00
|
|
|
'variables': {
|
|
|
|
'linker_gcc_preprocess_defines': [
|
2014-02-10 20:19:22 +04:00
|
|
|
'--defines', 'ENABLE_CHROMIUM_LINKER',
|
2013-10-22 01:40:44 +04:00
|
|
|
],
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
'variables': {
|
|
|
|
'linker_gcc_preprocess_defines': [],
|
|
|
|
},
|
|
|
|
}],
|
2014-02-10 20:19:22 +04:00
|
|
|
['enable_chromium_linker_tests == 1', {
|
2013-10-22 01:40:44 +04:00
|
|
|
'variables': {
|
|
|
|
'linker_tests_gcc_preprocess_defines': [
|
2014-02-10 20:19:22 +04:00
|
|
|
'--defines', 'ENABLE_CHROMIUM_LINKER_TESTS',
|
2013-10-22 01:40:44 +04:00
|
|
|
],
|
|
|
|
}
|
|
|
|
}, {
|
|
|
|
'variables': {
|
|
|
|
'linker_tests_gcc_preprocess_defines': [],
|
|
|
|
},
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'gcc_preprocess_defines': [
|
|
|
|
'<@(linker_gcc_preprocess_defines)',
|
|
|
|
'<@(linker_tests_gcc_preprocess_defines)',
|
|
|
|
],
|
|
|
|
},
|
2014-01-09 10:50:54 +04:00
|
|
|
'message': 'Creating NativeLibraries.java for <(_target_name)',
|
2013-04-02 03:12:33 +04:00
|
|
|
'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-11-28 18:28:52 +04:00
|
|
|
'<(native_libraries_template_data_file)',
|
|
|
|
'<(native_libraries_template_version_file)',
|
2013-04-02 03:12:33 +04:00
|
|
|
'<(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-10-22 01:40:44 +04:00
|
|
|
'<@(gcc_preprocess_defines)',
|
2013-04-02 03:12:33 +04:00
|
|
|
],
|
|
|
|
},
|
2013-04-02 07:23:14 +04:00
|
|
|
{
|
2013-05-16 06:40:29 +04:00
|
|
|
'action_name': 'strip_native_libraries',
|
2013-04-18 11:23:26 +04:00
|
|
|
'variables': {
|
2013-05-16 06:40:29 +04:00
|
|
|
'ordered_libraries_file%': '<(ordered_libraries_file)',
|
2013-04-18 11:23:26 +04:00
|
|
|
'stripped_libraries_dir': '<(libraries_source_dir)',
|
2013-09-20 21:44:33 +04:00
|
|
|
'input_paths': [
|
|
|
|
'<@(native_libs_paths)',
|
|
|
|
'<@(extra_native_libs)',
|
|
|
|
],
|
2013-05-16 06:40:29 +04:00
|
|
|
'stamp': '<(strip_stamp)'
|
2013-04-18 11:23:26 +04:00
|
|
|
},
|
|
|
|
'includes': ['../build/android/strip_native_libraries.gypi'],
|
2013-04-02 07:23:14 +04:00
|
|
|
},
|
2013-04-02 03:12:33 +04:00
|
|
|
],
|
2013-04-03 00:36:13 +04:00
|
|
|
'conditions': [
|
|
|
|
['gyp_managed_install == 1', {
|
|
|
|
'variables': {
|
2013-06-25 22:42:07 +04:00
|
|
|
'libraries_top_dir': '<(intermediate_dir)/lib.stripped',
|
|
|
|
'libraries_source_dir': '<(libraries_top_dir)/lib/<(android_app_abi)',
|
2013-04-23 22:30:26 +04:00
|
|
|
'device_library_dir': '<(device_intermediate_dir)/lib.stripped',
|
2013-09-10 05:39:25 +04:00
|
|
|
'configuration_name': '<(CONFIGURATION_NAME)',
|
2013-04-03 00:36:13 +04:00
|
|
|
},
|
|
|
|
'dependencies': [
|
[Android] Add an action to check/record attached devices
When doing a gyp_managed_install, we install APKs to the attached
device. Currently this can fail in many ways (no device attached,
multiple devices attached, device offline, device doesn't have root,
etc.). In addition, we need to detect changes to the attached device
(particularly when the device is switched, when an APK is
uninstalled/updated).
The current approach is to check all this information in the action
interacting with the device. This means that when there is some
problem we print the same warning messages for every APK that is built,
and, in some cases, multiple times for each APK. Also, we have to run
every install/push action every build because we detect changes to the
attached device in that action.
This change creates a new build action, "get device configurations".
This action inspects the attached devices, filters out offline devices,
filters out devices without root, and then writes a configuration
file with the id+metadata for the first non-filtered device. This
configuration is then used by each of the build steps that interacts
with the device. This consolidates all the device checking to a single
place, and the build actions don't need to do any checking. In
addition, to detect changes in the attached device, we only need to run
this single action every build and the install/push actions will only
change when the device/metadata changes.
Also, with this change we can now gracefully handle the case where
multiple devices are attached (currently just write the configuration
for the first valid device and install to that one).
Review URL: https://chromiumcodereview.appspot.com/16831013
git-svn-id: http://src.chromium.org/svn/trunk/src/build@209582 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-07-02 05:52:33 +04:00
|
|
|
'<(DEPTH)/build/android/setup.gyp:get_build_device_configurations',
|
2013-04-03 00:36:13 +04:00
|
|
|
],
|
|
|
|
'actions': [
|
|
|
|
{
|
2013-04-18 11:23:26 +04:00
|
|
|
'includes': ['../build/android/push_libraries.gypi'],
|
2013-04-03 00:36:13 +04:00
|
|
|
},
|
|
|
|
{
|
2013-04-19 13:16:13 +04:00
|
|
|
'action_name': 'create device library symlinks',
|
2014-01-09 10:50:54 +04:00
|
|
|
'message': 'Creating links on device for <(_target_name)',
|
2013-04-03 00:36:13 +04:00
|
|
|
'inputs': [
|
2013-04-19 13:16:13 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2013-04-03 00:36:13 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/create_device_library_links.py',
|
2013-04-19 13:16:13 +04:00
|
|
|
'<(apk_install_record)',
|
[Android] Add an action to check/record attached devices
When doing a gyp_managed_install, we install APKs to the attached
device. Currently this can fail in many ways (no device attached,
multiple devices attached, device offline, device doesn't have root,
etc.). In addition, we need to detect changes to the attached device
(particularly when the device is switched, when an APK is
uninstalled/updated).
The current approach is to check all this information in the action
interacting with the device. This means that when there is some
problem we print the same warning messages for every APK that is built,
and, in some cases, multiple times for each APK. Also, we have to run
every install/push action every build because we detect changes to the
attached device in that action.
This change creates a new build action, "get device configurations".
This action inspects the attached devices, filters out offline devices,
filters out devices without root, and then writes a configuration
file with the id+metadata for the first non-filtered device. This
configuration is then used by each of the build steps that interacts
with the device. This consolidates all the device checking to a single
place, and the build actions don't need to do any checking. In
addition, to detect changes in the attached device, we only need to run
this single action every build and the install/push actions will only
change when the device/metadata changes.
Also, with this change we can now gracefully handle the case where
multiple devices are attached (currently just write the configuration
for the first valid device and install to that one).
Review URL: https://chromiumcodereview.appspot.com/16831013
git-svn-id: http://src.chromium.org/svn/trunk/src/build@209582 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-07-02 05:52:33 +04:00
|
|
|
'<(build_device_config_path)',
|
2013-04-19 13:16:13 +04:00
|
|
|
'<(ordered_libraries_file)',
|
2013-04-03 00:36:13 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(link_stamp)'
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/create_device_library_links.py',
|
[Android] Add an action to check/record attached devices
When doing a gyp_managed_install, we install APKs to the attached
device. Currently this can fail in many ways (no device attached,
multiple devices attached, device offline, device doesn't have root,
etc.). In addition, we need to detect changes to the attached device
(particularly when the device is switched, when an APK is
uninstalled/updated).
The current approach is to check all this information in the action
interacting with the device. This means that when there is some
problem we print the same warning messages for every APK that is built,
and, in some cases, multiple times for each APK. Also, we have to run
every install/push action every build because we detect changes to the
attached device in that action.
This change creates a new build action, "get device configurations".
This action inspects the attached devices, filters out offline devices,
filters out devices without root, and then writes a configuration
file with the id+metadata for the first non-filtered device. This
configuration is then used by each of the build steps that interacts
with the device. This consolidates all the device checking to a single
place, and the build actions don't need to do any checking. In
addition, to detect changes in the attached device, we only need to run
this single action every build and the install/push actions will only
change when the device/metadata changes.
Also, with this change we can now gracefully handle the case where
multiple devices are attached (currently just write the configuration
for the first valid device and install to that one).
Review URL: https://chromiumcodereview.appspot.com/16831013
git-svn-id: http://src.chromium.org/svn/trunk/src/build@209582 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-07-02 05:52:33 +04:00
|
|
|
'--build-device-configuration=<(build_device_config_path)',
|
2013-04-03 00:36:13 +04:00
|
|
|
'--libraries-json=<(ordered_libraries_file)',
|
2013-04-19 13:16:13 +04:00
|
|
|
'--script-host-path=<(symlink_script_host_path)',
|
|
|
|
'--script-device-path=<(symlink_script_device_path)',
|
2013-04-03 00:36:13 +04:00
|
|
|
'--target-dir=<(device_library_dir)',
|
2013-06-25 22:42:07 +04:00
|
|
|
'--apk=<(incomplete_apk_path)',
|
2013-04-03 00:36:13 +04:00
|
|
|
'--stamp=<(link_stamp)',
|
2013-09-10 05:39:25 +04:00
|
|
|
'--configuration-name=<(CONFIGURATION_NAME)',
|
2013-04-03 00:36:13 +04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
2013-06-25 22:42:07 +04:00
|
|
|
'conditions': [
|
|
|
|
['create_standalone_apk == 1', {
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'create standalone APK',
|
|
|
|
'variables': {
|
|
|
|
'inputs': [
|
|
|
|
'<(ordered_libraries_file)',
|
|
|
|
'<(strip_stamp)',
|
|
|
|
],
|
|
|
|
'input_apk_path': '<(unsigned_apk_path)',
|
|
|
|
'output_apk_path': '<(unsigned_standalone_apk_path)',
|
|
|
|
'libraries_top_dir%': '<(libraries_top_dir)',
|
|
|
|
},
|
|
|
|
'includes': [ 'android/create_standalone_apk_action.gypi' ],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}],
|
|
|
|
],
|
2013-04-03 00:36:13 +04:00
|
|
|
}, {
|
2013-04-05 07:41:57 +04:00
|
|
|
# gyp_managed_install != 1
|
2013-04-03 00:36:13 +04:00
|
|
|
'variables': {
|
2013-04-18 11:23:26 +04:00
|
|
|
'libraries_source_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-06-25 22:42:07 +04:00
|
|
|
['gyp_managed_install == 0 or create_standalone_apk == 1', {
|
|
|
|
'actions': [
|
|
|
|
{
|
|
|
|
'action_name': 'finalize standalone apk',
|
|
|
|
'variables': {
|
|
|
|
'input_apk_path': '<(unsigned_standalone_apk_path)',
|
|
|
|
'output_apk_path': '<(final_apk_path)',
|
|
|
|
},
|
|
|
|
'includes': [ 'android/finalize_apk_action.gypi']
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}],
|
2013-04-02 20:55:46 +04:00
|
|
|
['gyp_managed_install == 1', {
|
|
|
|
'actions': [
|
2013-06-25 22:42:07 +04:00
|
|
|
{
|
|
|
|
'action_name': 'finalize incomplete apk',
|
|
|
|
'variables': {
|
|
|
|
'input_apk_path': '<(unsigned_apk_path)',
|
|
|
|
'output_apk_path': '<(incomplete_apk_path)',
|
|
|
|
},
|
|
|
|
'includes': [ 'android/finalize_apk_action.gypi']
|
|
|
|
},
|
2013-04-02 20:55:46 +04:00
|
|
|
{
|
|
|
|
'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',
|
[Android] Add an action to check/record attached devices
When doing a gyp_managed_install, we install APKs to the attached
device. Currently this can fail in many ways (no device attached,
multiple devices attached, device offline, device doesn't have root,
etc.). In addition, we need to detect changes to the attached device
(particularly when the device is switched, when an APK is
uninstalled/updated).
The current approach is to check all this information in the action
interacting with the device. This means that when there is some
problem we print the same warning messages for every APK that is built,
and, in some cases, multiple times for each APK. Also, we have to run
every install/push action every build because we detect changes to the
attached device in that action.
This change creates a new build action, "get device configurations".
This action inspects the attached devices, filters out offline devices,
filters out devices without root, and then writes a configuration
file with the id+metadata for the first non-filtered device. This
configuration is then used by each of the build steps that interacts
with the device. This consolidates all the device checking to a single
place, and the build actions don't need to do any checking. In
addition, to detect changes in the attached device, we only need to run
this single action every build and the install/push actions will only
change when the device/metadata changes.
Also, with this change we can now gracefully handle the case where
multiple devices are attached (currently just write the configuration
for the first valid device and install to that one).
Review URL: https://chromiumcodereview.appspot.com/16831013
git-svn-id: http://src.chromium.org/svn/trunk/src/build@209582 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-07-02 05:52:33 +04:00
|
|
|
'<(build_device_config_path)',
|
2013-06-25 22:42:07 +04:00
|
|
|
'<(incomplete_apk_path)',
|
2013-04-02 20:55:46 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
2013-04-19 13:16:13 +04:00
|
|
|
'<(apk_install_record)',
|
2013-04-02 20:55:46 +04:00
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/apk_install.py',
|
2013-06-25 22:42:07 +04:00
|
|
|
'--apk-path=<(incomplete_apk_path)',
|
[Android] Add an action to check/record attached devices
When doing a gyp_managed_install, we install APKs to the attached
device. Currently this can fail in many ways (no device attached,
multiple devices attached, device offline, device doesn't have root,
etc.). In addition, we need to detect changes to the attached device
(particularly when the device is switched, when an APK is
uninstalled/updated).
The current approach is to check all this information in the action
interacting with the device. This means that when there is some
problem we print the same warning messages for every APK that is built,
and, in some cases, multiple times for each APK. Also, we have to run
every install/push action every build because we detect changes to the
attached device in that action.
This change creates a new build action, "get device configurations".
This action inspects the attached devices, filters out offline devices,
filters out devices without root, and then writes a configuration
file with the id+metadata for the first non-filtered device. This
configuration is then used by each of the build steps that interacts
with the device. This consolidates all the device checking to a single
place, and the build actions don't need to do any checking. In
addition, to detect changes in the attached device, we only need to run
this single action every build and the install/push actions will only
change when the device/metadata changes.
Also, with this change we can now gracefully handle the case where
multiple devices are attached (currently just write the configuration
for the first valid device and install to that one).
Review URL: https://chromiumcodereview.appspot.com/16831013
git-svn-id: http://src.chromium.org/svn/trunk/src/build@209582 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2013-07-02 05:52:33 +04:00
|
|
|
'--build-device-configuration=<(build_device_config_path)',
|
|
|
|
'--install-record=<(apk_install_record)',
|
2013-09-10 05:39:25 +04:00
|
|
|
'--configuration-name=<(CONFIGURATION_NAME)',
|
2013-04-02 20:55:46 +04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}],
|
2013-08-14 03:46:39 +04:00
|
|
|
['is_test_apk == 1', {
|
|
|
|
'dependencies': [
|
|
|
|
'<(DEPTH)/tools/android/android_tools.gyp:android_tools',
|
|
|
|
]
|
|
|
|
}],
|
2013-01-16 21:54:42 +04:00
|
|
|
],
|
2013-09-19 20:33:08 +04:00
|
|
|
'dependencies': [
|
|
|
|
'<(DEPTH)/tools/android/md5sum/md5sum.gyp:md5sum',
|
|
|
|
],
|
2012-09-19 08:16:27 +04:00
|
|
|
'actions': [
|
|
|
|
{
|
2014-05-27 09:42:45 +04:00
|
|
|
'action_name': 'process_resources',
|
|
|
|
'message': 'processing resources for <(_target_name)',
|
|
|
|
'variables': {
|
|
|
|
# Write the inputs list to a file, so that its mtime is updated when
|
|
|
|
# the list of inputs changes.
|
|
|
|
'inputs_list_file': '>|(apk_codegen.<(_target_name).gypcmd >@(additional_input_paths) >@(resource_input_paths))',
|
|
|
|
},
|
2013-03-26 21:35:21 +04:00
|
|
|
'conditions': [
|
|
|
|
['is_test_apk == 1', {
|
|
|
|
'variables': {
|
|
|
|
'additional_res_dirs=': [],
|
|
|
|
'additional_res_packages=': [],
|
|
|
|
}
|
|
|
|
}],
|
|
|
|
],
|
|
|
|
'inputs': [
|
2013-04-05 07:41:57 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
2014-05-27 09:42:45 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/process_resources.py',
|
2013-04-06 04:14:39 +04:00
|
|
|
'<(android_manifest_path)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'>@(additional_input_paths)',
|
2013-04-11 03:10:17 +04:00
|
|
|
'>@(resource_input_paths)',
|
2014-03-21 03:22:44 +04:00
|
|
|
'>(inputs_list_file)',
|
2013-03-26 21:35:21 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
2014-05-27 09:42:45 +04:00
|
|
|
'<(generated_proguard_file)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'<(codegen_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2014-05-27 09:42:45 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/process_resources.py',
|
|
|
|
'--android-sdk', '<(android_sdk)',
|
|
|
|
'--android-sdk-tools', '<(android_sdk_tools)',
|
|
|
|
|
|
|
|
'--android-manifest', '<(android_manifest_path)',
|
|
|
|
'--dependencies-res-dirs', '>(additional_res_dirs)',
|
|
|
|
|
|
|
|
'--extra-res-packages', '>(additional_res_packages)',
|
|
|
|
'--extra-r-text-files', '>(additional_R_text_files)',
|
|
|
|
|
|
|
|
'--proguard-file', '<(generated_proguard_file)',
|
|
|
|
|
|
|
|
'--resource-dir', '<(resource_dir)',
|
2014-05-28 23:50:08 +04:00
|
|
|
'--crunch-output-dir', '<(crunch_output_dir)',
|
2014-05-27 09:42:45 +04:00
|
|
|
|
|
|
|
'--R-dir', '<(intermediate_dir)/gen',
|
2013-03-26 21:35:21 +04:00
|
|
|
|
2014-05-27 09:42:45 +04:00
|
|
|
'--stamp', '<(codegen_stamp)',
|
2013-03-26 21:35:21 +04:00
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
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': {
|
android: Pass (non-generated) .java files via a gyp filelist to javac.py
Before this CL, the javac action rules called `find javadir -name "*.java"` to
compute the action's inputs, and passed javadir to javac.py. The script then
again looked for all .java files in that directory. One issue with that approach
is that if a java file gets removed, the javac.py action didn't get executed again
since actions are only run if their commandline changes or an input file is newer
than an output file – a disappearing input doesn't mark an action dirty. (As
workaround, the md5 hash of all .java files is currently passed in an
--ignore parameter, so removal of a java file will lead to a changing
commandline, which _will_ cause a rebuild.)
After this CL, the result of `find javadir -name "*.java"` is written to a gyp
filelist (see https://codereview.chromium.org/27418008/), and the filelist
is passed to javac.py. gyp writes filelists exactly if their contents would
change, so removal of java file will change the mtime of the filelist, which will
cause a rebuild. Another advantage is that the list of java files is computed in
only one place.
This CL doesn't yet remove the md5 hack, but it makes it possible to do so
in a follow-up change.
(This approach doesn't work for generated java files, because these might
not yet exist at gyp time. Rename --src-dirs to --src-gendirs and keep it in
use for generated files. The dependency handling of generated java files is
done through stamp files, so the md5 hack isn't needed for them.)
No intended behavior change.
BUG=177552
R=cjhopman@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256097
Review URL: https://codereview.chromium.org/193693002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@256667 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-13 01:56:41 +04:00
|
|
|
'gen_src_dirs': [
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(intermediate_dir)/gen',
|
|
|
|
'>@(generated_src_dirs)',
|
|
|
|
],
|
android: Pass (non-generated) .java files via a gyp filelist to javac.py
Before this CL, the javac action rules called `find javadir -name "*.java"` to
compute the action's inputs, and passed javadir to javac.py. The script then
again looked for all .java files in that directory. One issue with that approach
is that if a java file gets removed, the javac.py action didn't get executed again
since actions are only run if their commandline changes or an input file is newer
than an output file – a disappearing input doesn't mark an action dirty. (As
workaround, the md5 hash of all .java files is currently passed in an
--ignore parameter, so removal of a java file will lead to a changing
commandline, which _will_ cause a rebuild.)
After this CL, the result of `find javadir -name "*.java"` is written to a gyp
filelist (see https://codereview.chromium.org/27418008/), and the filelist
is passed to javac.py. gyp writes filelists exactly if their contents would
change, so removal of java file will change the mtime of the filelist, which will
cause a rebuild. Another advantage is that the list of java files is computed in
only one place.
This CL doesn't yet remove the md5 hack, but it makes it possible to do so
in a follow-up change.
(This approach doesn't work for generated java files, because these might
not yet exist at gyp time. Rename --src-dirs to --src-gendirs and keep it in
use for generated files. The dependency handling of generated java files is
done through stamp files, so the md5 hack isn't needed for them.)
No intended behavior change.
BUG=177552
R=cjhopman@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256097
Review URL: https://codereview.chromium.org/193693002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@256667 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-13 01:56:41 +04:00
|
|
|
# If there is a separate find for additional_src_dirs, it will find the
|
|
|
|
# wrong .java files when additional_src_dirs is empty.
|
|
|
|
# TODO(thakis): Gyp caches >! evaluation by command. Both java.gypi and
|
|
|
|
# java_apk.gypi evaluate the same command, and at the moment two targets
|
|
|
|
# set java_in_dir to "java". Add a dummy comment here to make sure
|
|
|
|
# that the two targets (one uses java.gypi, the other java_apk.gypi)
|
|
|
|
# get distinct source lists. Medium-term, make targets list all their
|
|
|
|
# Java files instead of using find. (As is, this will be broken if two
|
|
|
|
# targets use the same java_in_dir and both use java_apk.gypi or
|
|
|
|
# both use java.gypi.)
|
2014-03-13 19:47:16 +04:00
|
|
|
'java_sources': ['>!@(find >(java_in_dir)/src >(additional_src_dirs) -name "*.java" # apk)'],
|
android: Pass (non-generated) .java files via a gyp filelist to javac.py
Before this CL, the javac action rules called `find javadir -name "*.java"` to
compute the action's inputs, and passed javadir to javac.py. The script then
again looked for all .java files in that directory. One issue with that approach
is that if a java file gets removed, the javac.py action didn't get executed again
since actions are only run if their commandline changes or an input file is newer
than an output file – a disappearing input doesn't mark an action dirty. (As
workaround, the md5 hash of all .java files is currently passed in an
--ignore parameter, so removal of a java file will lead to a changing
commandline, which _will_ cause a rebuild.)
After this CL, the result of `find javadir -name "*.java"` is written to a gyp
filelist (see https://codereview.chromium.org/27418008/), and the filelist
is passed to javac.py. gyp writes filelists exactly if their contents would
change, so removal of java file will change the mtime of the filelist, which will
cause a rebuild. Another advantage is that the list of java files is computed in
only one place.
This CL doesn't yet remove the md5 hack, but it makes it possible to do so
in a follow-up change.
(This approach doesn't work for generated java files, because these might
not yet exist at gyp time. Rename --src-dirs to --src-gendirs and keep it in
use for generated files. The dependency handling of generated java files is
done through stamp files, so the md5 hack isn't needed for them.)
No intended behavior change.
BUG=177552
R=cjhopman@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256097
Review URL: https://codereview.chromium.org/193693002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@256667 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-13 01:56:41 +04:00
|
|
|
|
2013-03-27 00:44:29 +04:00
|
|
|
},
|
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',
|
2014-03-13 19:47:16 +04:00
|
|
|
'>@(java_sources)',
|
2012-09-19 08:16:27 +04:00
|
|
|
'>@(input_jars_paths)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'<(codegen_stamp)',
|
android: Remove three unnecessary md5sum calls.
After r256667, the list of java files for javac is written into a gyp
filelist, which gets rewritten if a java file is removed. (If a generated
java file is removed, that still doesn't cause a rebuild, but that didn't
happen before this CL either, http://crbug.com/) This allows removing the
md5sum call for javac in java_apk.gypi.
java.gypi also has additional_input_paths as input, but that's only used
for stamp files, for ordering purposes, so it's not necessary to re-run
the javac action if a stamp file disappears from additional_input_paths.
With the same reasoning, the md5sum call in 'ant package resources' is not
needed: additional_input_paths is the only non-stamp input that isn't also
on the command line. ('ant package resources' is missing some inputs, but
that's independent of this change: http://crbug.com/351928)
No behavior change.
BUG=177552
R=cjhopman@chromium.org
Review URL: https://codereview.chromium.org/198283003
git-svn-id: http://src.chromium.org/svn/trunk/src/build@256746 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-13 08:48:10 +04:00
|
|
|
],
|
|
|
|
'conditions': [
|
|
|
|
['native_lib_target != ""', {
|
|
|
|
'inputs': [ '<(native_libraries_java_stamp)' ],
|
|
|
|
}],
|
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)',
|
android: Pass (non-generated) .java files via a gyp filelist to javac.py
Before this CL, the javac action rules called `find javadir -name "*.java"` to
compute the action's inputs, and passed javadir to javac.py. The script then
again looked for all .java files in that directory. One issue with that approach
is that if a java file gets removed, the javac.py action didn't get executed again
since actions are only run if their commandline changes or an input file is newer
than an output file – a disappearing input doesn't mark an action dirty. (As
workaround, the md5 hash of all .java files is currently passed in an
--ignore parameter, so removal of a java file will lead to a changing
commandline, which _will_ cause a rebuild.)
After this CL, the result of `find javadir -name "*.java"` is written to a gyp
filelist (see https://codereview.chromium.org/27418008/), and the filelist
is passed to javac.py. gyp writes filelists exactly if their contents would
change, so removal of java file will change the mtime of the filelist, which will
cause a rebuild. Another advantage is that the list of java files is computed in
only one place.
This CL doesn't yet remove the md5 hack, but it makes it possible to do so
in a follow-up change.
(This approach doesn't work for generated java files, because these might
not yet exist at gyp time. Rename --src-dirs to --src-gendirs and keep it in
use for generated files. The dependency handling of generated java files is
done through stamp files, so the md5 hack isn't needed for them.)
No intended behavior change.
BUG=177552
R=cjhopman@chromium.org
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256097
Review URL: https://codereview.chromium.org/193693002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@256667 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-13 01:56:41 +04:00
|
|
|
'--src-gendirs=>(gen_src_dirs)',
|
2013-03-27 00:44:29 +04:00
|
|
|
'--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)',
|
2014-03-17 22:23:12 +04:00
|
|
|
'>@(java_sources)',
|
2013-03-27 00:44:29 +04:00
|
|
|
],
|
|
|
|
},
|
2013-12-11 07:02:10 +04:00
|
|
|
{
|
|
|
|
'variables': {
|
|
|
|
'src_dirs': [
|
|
|
|
'<(java_in_dir)/src',
|
|
|
|
'>@(additional_src_dirs)',
|
|
|
|
],
|
|
|
|
'stamp_path': '<(lint_stamp)',
|
|
|
|
'result_path': '<(lint_result)',
|
|
|
|
'config_path': '<(lint_config)',
|
|
|
|
},
|
|
|
|
'inputs': [
|
|
|
|
'<(compile_stamp)',
|
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(lint_stamp)',
|
|
|
|
],
|
|
|
|
'includes': [ 'android/lint_action.gypi' ],
|
|
|
|
},
|
2013-08-22 04:08:31 +04:00
|
|
|
{
|
|
|
|
'action_name': 'instr_classes_<(_target_name)',
|
|
|
|
'message': 'Instrumenting <(_target_name) classes',
|
|
|
|
'variables': {
|
|
|
|
'input_path': '<(classes_dir)',
|
|
|
|
'output_path': '<(classes_final_dir)',
|
|
|
|
'stamp_path': '<(instr_stamp)',
|
|
|
|
'instr_type': 'classes',
|
|
|
|
},
|
|
|
|
'inputs': [
|
|
|
|
'<(compile_stamp)',
|
|
|
|
],
|
2013-12-11 07:02:10 +04:00
|
|
|
'outputs': [
|
|
|
|
'<(instr_stamp)',
|
|
|
|
],
|
2013-08-22 04:08:31 +04:00
|
|
|
'includes': [ 'android/instr_action.gypi' ],
|
|
|
|
},
|
2013-03-27 00:44:29 +04:00
|
|
|
{
|
|
|
|
'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',
|
2014-03-07 01:41:00 +04:00
|
|
|
'<(instr_stamp)',
|
2013-03-27 00:44:29 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(jar_stamp)',
|
|
|
|
],
|
|
|
|
'action': [
|
2013-04-04 13:35:50 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/jar.py',
|
2013-08-22 04:08:31 +04:00
|
|
|
'--classes-dir=<(classes_final_dir)',
|
2013-03-27 00:44:29 +04:00
|
|
|
'--jar-path=<(jar_path)',
|
|
|
|
'--excluded-classes=<(jar_excluded_classes)',
|
|
|
|
'--stamp=<(jar_stamp)',
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'ant_obfuscate_<(_target_name)',
|
|
|
|
'message': 'Obfuscating <(_target_name)',
|
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/ant/apk-obfuscate.xml',
|
2013-04-05 07:41:57 +04:00
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/ant.py',
|
2014-03-11 01:36:51 +04:00
|
|
|
'<(android_manifest_path)',
|
2013-04-02 13:10:54 +04:00
|
|
|
'>@(proguard_flags_paths)',
|
2014-03-07 02:36:52 +04:00
|
|
|
'<(instr_stamp)',
|
2013-03-27 00:44:29 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
android: Make dex_action.gypi not call md5sum.
No intended behavior change.
dex_action.gypi didn't pass its input_paths variable to dex.py,
but that was only set in a single place, and only to a single file there.
It was only used in java_apk.gypi which does manual threading of
stamp files to order actions (since it's a gypi, it can't easily use type
none targets with dependencies). Since dex.py doesn't look at this
stamp file at all, it doesn't need to rerun when the stamp file disappears.
To make this a bit more obvious, remove dex_action.gypi's input_paths
variable and set 'inputs' directly in the one place with the stamp file.
(dex.py will still rerun if the name of the stamp file changes, due to
regular timestamp handling.)
java_apk.gypi used to set input_paths to two files in proguard-enabled
files – change it to depend only on obfuscate_stamp in proguard builds,
as the step that writes that already depends on instr_stamp. (This isn't
necessary as the proguard state is part of the dex.py commandline, so
toggling between proguard and no proguard would rebuild correctly
anyways, but it's conceptually a bit nicer.)
Also set proguard_enabled_input_path unconditionally. Again, no behavior
change, but keeps the gyp a bit shorter.
BUG=177552
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255325
R=cjhopman@chromium.org
Review URL: https://codereview.chromium.org/183883024
git-svn-id: http://src.chromium.org/svn/trunk/src/build@255403 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-06 22:47:27 +04:00
|
|
|
# This lists obfuscate_stamp instead of obfuscated_jar_path because
|
|
|
|
# ant only writes the latter if the md5 of the inputs changes.
|
2013-03-27 00:44:29 +04:00
|
|
|
'<(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',
|
2014-03-11 01:36:51 +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)',
|
2013-08-09 10:48:18 +04:00
|
|
|
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DAPK_NAME=<(apk_name)',
|
2013-03-27 13:04:27 +04:00
|
|
|
'-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
|
2013-03-26 21:35:21 +04:00
|
|
|
'-DINPUT_JARS_PATHS=>(input_jars_paths)',
|
|
|
|
'-DIS_TEST_APK=<(is_test_apk)',
|
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
|
|
|
],
|
|
|
|
},
|
2013-03-27 00:44:29 +04:00
|
|
|
{
|
|
|
|
'action_name': 'dex_<(_target_name)',
|
|
|
|
'variables': {
|
|
|
|
'conditions': [
|
2013-08-22 04:08:31 +04:00
|
|
|
['emma_instrument != 0', {
|
|
|
|
'dex_no_locals': 1,
|
2013-08-23 07:44:54 +04:00
|
|
|
'dex_input_paths': [ '<(emma_device_jar)' ],
|
|
|
|
}],
|
2013-03-27 00:44:29 +04:00
|
|
|
],
|
2013-05-18 06:33:37 +04:00
|
|
|
'dex_input_paths': [ '>@(library_dexed_jars_paths)' ],
|
2013-08-22 04:08:31 +04:00
|
|
|
'dex_generated_input_dirs': [ '<(classes_final_dir)' ],
|
2013-05-18 06:33:37 +04:00
|
|
|
'output_path': '<(dex_path)',
|
android: Make dex_action.gypi not call md5sum.
No intended behavior change.
dex_action.gypi didn't pass its input_paths variable to dex.py,
but that was only set in a single place, and only to a single file there.
It was only used in java_apk.gypi which does manual threading of
stamp files to order actions (since it's a gypi, it can't easily use type
none targets with dependencies). Since dex.py doesn't look at this
stamp file at all, it doesn't need to rerun when the stamp file disappears.
To make this a bit more obvious, remove dex_action.gypi's input_paths
variable and set 'inputs' directly in the one place with the stamp file.
(dex.py will still rerun if the name of the stamp file changes, due to
regular timestamp handling.)
java_apk.gypi used to set input_paths to two files in proguard-enabled
files – change it to depend only on obfuscate_stamp in proguard builds,
as the step that writes that already depends on instr_stamp. (This isn't
necessary as the proguard state is part of the dex.py commandline, so
toggling between proguard and no proguard would rebuild correctly
anyways, but it's conceptually a bit nicer.)
Also set proguard_enabled_input_path unconditionally. Again, no behavior
change, but keeps the gyp a bit shorter.
BUG=177552
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255325
R=cjhopman@chromium.org
Review URL: https://codereview.chromium.org/183883024
git-svn-id: http://src.chromium.org/svn/trunk/src/build@255403 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-06 22:47:27 +04:00
|
|
|
'proguard_enabled_input_path': '<(obfuscated_jar_path)',
|
2013-03-27 00:44:29 +04:00
|
|
|
},
|
android: Make dex_action.gypi not call md5sum.
No intended behavior change.
dex_action.gypi didn't pass its input_paths variable to dex.py,
but that was only set in a single place, and only to a single file there.
It was only used in java_apk.gypi which does manual threading of
stamp files to order actions (since it's a gypi, it can't easily use type
none targets with dependencies). Since dex.py doesn't look at this
stamp file at all, it doesn't need to rerun when the stamp file disappears.
To make this a bit more obvious, remove dex_action.gypi's input_paths
variable and set 'inputs' directly in the one place with the stamp file.
(dex.py will still rerun if the name of the stamp file changes, due to
regular timestamp handling.)
java_apk.gypi used to set input_paths to two files in proguard-enabled
files – change it to depend only on obfuscate_stamp in proguard builds,
as the step that writes that already depends on instr_stamp. (This isn't
necessary as the proguard state is part of the dex.py commandline, so
toggling between proguard and no proguard would rebuild correctly
anyways, but it's conceptually a bit nicer.)
Also set proguard_enabled_input_path unconditionally. Again, no behavior
change, but keeps the gyp a bit shorter.
BUG=177552
NOTRY=true
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=255325
R=cjhopman@chromium.org
Review URL: https://codereview.chromium.org/183883024
git-svn-id: http://src.chromium.org/svn/trunk/src/build@255403 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
2014-03-06 22:47:27 +04:00
|
|
|
'conditions': [
|
|
|
|
['proguard_enabled == "true"', { 'inputs': [ '<(obfuscate_stamp)' ] },
|
|
|
|
{ 'inputs': [ '<(instr_stamp)' ] }],
|
|
|
|
],
|
2013-05-18 06:33:37 +04:00
|
|
|
'includes': [ 'android/dex_action.gypi' ],
|
2013-03-27 00:44:29 +04:00
|
|
|
},
|
2013-03-26 21:35:21 +04:00
|
|
|
{
|
2014-05-28 23:50:08 +04:00
|
|
|
'action_name': 'package_resources',
|
|
|
|
'message': 'packaging resources for <(_target_name)',
|
|
|
|
'variables': {
|
|
|
|
'extra_package_input_paths': [
|
|
|
|
'>@(package_input_paths)',
|
|
|
|
'>@(additional_input_paths)',
|
|
|
|
'>@(resource_input_paths)'
|
|
|
|
],
|
|
|
|
'package_resource_dirs': [
|
|
|
|
# <(crunch_output_dir) must come before <(resource_dir) so that
|
|
|
|
# the crunched files take precedence.
|
|
|
|
'<(crunch_output_dir)',
|
|
|
|
'<(resource_dir)',
|
|
|
|
'>@(additional_res_dirs)',
|
|
|
|
],
|
|
|
|
# Write the inputs list to a file, so that its mtime is updated when
|
|
|
|
# the list of inputs changes.
|
|
|
|
'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(extra_package_input_paths))',
|
|
|
|
},
|
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
|
|
|
],
|
2014-05-28 23:50:08 +04:00
|
|
|
'inputs': [
|
|
|
|
# TODO: This isn't always rerun correctly, http://crbug.com/351928
|
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/package_resources.py',
|
|
|
|
'<(android_manifest_path)',
|
|
|
|
|
|
|
|
'<(codegen_stamp)',
|
|
|
|
|
|
|
|
'>@(extra_package_input_paths)',
|
|
|
|
'>(inputs_list_file)',
|
|
|
|
],
|
2012-09-19 08:16:27 +04:00
|
|
|
'outputs': [
|
2014-05-28 23:50:08 +04:00
|
|
|
'<(resource_packaged_apk_path)',
|
2012-09-19 08:16:27 +04:00
|
|
|
],
|
|
|
|
'action': [
|
2014-05-28 23:50:08 +04:00
|
|
|
'python', '<(DEPTH)/build/android/gyp/package_resources.py',
|
|
|
|
'--android-sdk', '<(android_sdk)',
|
|
|
|
'--android-sdk-tools', '<(android_sdk_tools)',
|
2013-04-11 03:10:17 +04:00
|
|
|
|
2014-05-28 23:50:08 +04:00
|
|
|
'--configuration-name', '<(CONFIGURATION_NAME)',
|
2013-04-11 03:10:17 +04:00
|
|
|
|
2014-05-28 23:50:08 +04:00
|
|
|
'--android-manifest', '<(android_manifest_path)',
|
|
|
|
'--version-code', '<(app_manifest_version_code)',
|
|
|
|
'--version-name', '<(app_manifest_version_name)',
|
|
|
|
|
|
|
|
'--asset-dir', '<(asset_location)',
|
|
|
|
'--resource-dirs', '>(package_resource_dirs)',
|
|
|
|
|
|
|
|
'--apk-path', '<(resource_packaged_apk_path)',
|
|
|
|
],
|
2013-04-11 03:10:17 +04:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'action_name': 'ant_package_<(_target_name)',
|
2014-01-09 10:50:54 +04:00
|
|
|
'message': 'Packaging <(_target_name)',
|
2014-03-21 03:22:44 +04:00
|
|
|
'variables': {
|
|
|
|
# Write the inputs list to a file, so that its mtime is updated when
|
|
|
|
# the list of inputs changes.
|
|
|
|
'inputs_list_file': '>|(apk_package.<(_target_name).gypcmd >@(package_input_paths))'
|
|
|
|
},
|
2013-04-11 03:10:17 +04:00
|
|
|
'inputs': [
|
|
|
|
'<(DEPTH)/build/android/ant/apk-package.xml',
|
|
|
|
'<(DEPTH)/build/android/gyp/util/build_utils.py',
|
|
|
|
'<(DEPTH)/build/android/gyp/ant.py',
|
|
|
|
'<(dex_path)',
|
|
|
|
'<(codegen_stamp)',
|
|
|
|
'<(obfuscate_stamp)',
|
2014-05-28 23:50:08 +04:00
|
|
|
'<(resource_packaged_apk_path)',
|
2013-04-11 03:10:17 +04:00
|
|
|
'>@(package_input_paths)',
|
2014-03-21 03:22:44 +04:00
|
|
|
'>(inputs_list_file)',
|
2013-04-11 03:10:17 +04:00
|
|
|
],
|
|
|
|
'outputs': [
|
|
|
|
'<(unsigned_apk_path)',
|
|
|
|
],
|
|
|
|
'action': [
|
|
|
|
'python', '<(DEPTH)/build/android/gyp/ant.py',
|
|
|
|
'-quiet',
|
|
|
|
'-DANDROID_SDK_ROOT=<(android_sdk_root)',
|
2013-08-09 10:48:18 +04:00
|
|
|
'-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
|
2014-05-28 23:50:08 +04:00
|
|
|
'-DRESOURCE_PACKAGED_APK_NAME=<(resource_packaged_apk_name)',
|
2013-04-11 03:10:17 +04:00
|
|
|
'-DAPK_NAME=<(apk_name)',
|
|
|
|
'-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)',
|
|
|
|
'-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)',
|
|
|
|
'-DOUT_DIR=<(intermediate_dir)',
|
2013-04-10 02:22:15 +04:00
|
|
|
'-DUNSIGNED_APK_PATH=<(unsigned_apk_path)',
|
2013-08-22 04:08:31 +04:00
|
|
|
'-DEMMA_INSTRUMENT=<(emma_instrument)',
|
|
|
|
'-DEMMA_DEVICE_JAR=<(emma_device_jar)',
|
2013-03-26 21:35:21 +04:00
|
|
|
|
|
|
|
'-Dbasedir=.',
|
|
|
|
'-buildfile',
|
|
|
|
'<(DEPTH)/build/android/ant/apk-package.xml',
|
2012-09-19 08:16:27 +04:00
|
|
|
]
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|