diff options
author | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-06 00:14:39 +0000 |
---|---|---|
committer | cjhopman@chromium.org <cjhopman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-04-06 00:14:39 +0000 |
commit | d82d769c83a7bfe28277dce0df3af4a70229b63d (patch) | |
tree | 8406ff722a8c581f31ea6c1397d3a2b91b9e6e61 | |
parent | 44ed4bd710c9f7fa80be0413a460e99d366fecb2 (diff) | |
download | chromium_src-d82d769c83a7bfe28277dce0df3af4a70229b63d.zip chromium_src-d82d769c83a7bfe28277dce0df3af4a70229b63d.tar.gz chromium_src-d82d769c83a7bfe28277dce0df3af4a70229b63d.tar.bz2 |
Use java_apk.gypi for gtest apks
Currently, normal APKs and instrumentation APKs are both built using
java_apk.gypi (which includes all kinds of new hotness). Native
unittest APKs, though use apk_test.gypi and thus the complicated
native_test_apk.xml and Android's Ant build.xml. That is bad.
This change updates apk_test.gypi to include java_apk.gypi and so
brings these two ways of building APKs into alignment. It also very
slightly updates the configurability of java_apk.gypi and
apk-package.xml.
There are still a couple of targets in WebKit that use
generate_native_test.py and native_test_apk.xml directly that need to
be updated to use apk_test.gypi before those two scripts can be
simplified/removed.
BUG=158821
Review URL: https://chromiumcodereview.appspot.com/13564003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@192662 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/android/ant/apk-package.xml | 4 | ||||
-rw-r--r-- | build/apk_test.gypi | 116 | ||||
-rw-r--r-- | build/java_apk.gypi | 14 |
3 files changed, 63 insertions, 71 deletions
diff --git a/build/android/ant/apk-package.xml b/build/android/ant/apk-package.xml index c01f0a2..51ceb02 100644 --- a/build/android/ant/apk-package.xml +++ b/build/android/ant/apk-package.xml @@ -46,9 +46,7 @@ <equals arg1="build.target" arg2="debug" /> </condition> - - <!-- Set the output directory for the final apk to the ${apks.dir}. --> - <property name="out.final.file" location="${APKS_DIR}/${APK_NAME}.apk" /> + <property name="out.final.file" location="${FINAL_APK_PATH}" /> <!-- Disables automatic signing. --> <property name="build.is.signing.debug" value="false"/> diff --git a/build/apk_test.gypi b/build/apk_test.gypi index 71577a1..de426f4 100644 --- a/build/apk_test.gypi +++ b/build/apk_test.gypi @@ -24,67 +24,59 @@ '<(DEPTH)/tools/android/android_tools.gyp:android_tools', ], 'variables': { - 'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk/', - 'generate_native_test_stamp': '<(intermediate_dir)/generate_native_test.stamp', + 'generator_intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk/generated/', + 'generate_native_test_stamp': '<(generator_intermediate_dir)/generate_native_test.stamp', }, - 'target_conditions': [ - ['_toolset == "target"', { - 'conditions': [ - ['OS == "android" and gtest_target_type == "shared_library"', { - 'actions': [{ - 'action_name': 'apk_<(test_suite_name)', - 'message': 'Building <(test_suite_name) test apk.', - 'inputs': [ - '<(DEPTH)/testing/android/AndroidManifest.xml', - '<(DEPTH)/testing/android/generate_native_test.py', - '<(input_shlib_path)', - '>@(input_jars_paths)', - ], - 'outputs': [ - '<(generate_native_test_stamp)', - ], - 'action': [ - '<(DEPTH)/testing/android/generate_native_test.py', - '--native_library', - '<(input_shlib_path)', - '--output', - '<(intermediate_dir)', - '--strip-binary=<(android_strip)', - '--app_abi', - '<(android_app_abi)', - '--stamp-file', - '<(generate_native_test_stamp)', - '--no-compile', - ], - }, - { - 'action_name': 'ant_apk_<(test_suite_name)', - 'message': 'Building <(test_suite_name) test apk.', - 'inputs': [ - '<(DEPTH)/build/android/gyp/util/build_utils.py', - '<(DEPTH)/build/android/gyp/ant.py', - '<(generate_native_test_stamp)', - ], - 'outputs': [ - '<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk', - ], - 'action': [ - 'python', '<(DEPTH)/build/android/gyp/ant.py', - '-quiet', - '-DPRODUCT_DIR=<(ant_build_out)', - '-DANDROID_SDK=<(android_sdk)', - '-DANDROID_SDK_ROOT=<(android_sdk_root)', - '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', - '-DANDROID_SDK_VERSION=<(android_sdk_version)', - '-DANDROID_GDBSERVER=<(android_gdbserver)', - '-DCHROMIUM_SRC=<(ant_build_out)/../..', - '-DINPUT_JARS_PATHS=>(input_jars_paths)', - '-DAPP_ABI=<(android_app_abi)', - '-buildfile', '<(intermediate_dir)/native_test_apk.xml', - ], - }], - }], # 'OS == "android" and gtest_target_type == "shared_library" - ], # conditions - }], - ], # target_conditions + 'conditions': [ + ['OS == "android" and gtest_target_type == "shared_library"', { + 'variables': { + # These are used to configure java_apk.gypi included below. + 'apk_name': '<(test_suite_name)', + 'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk', + 'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk', + 'java_in_dir': '<(DEPTH)/build/android/empty', + 'android_manifest_path': '<(generator_intermediate_dir)/AndroidManifest.xml', + 'native_lib_target': 'lib<(test_suite_name)', + 'generated_src_dirs': [ + '<(generator_intermediate_dir)/java', + ], + 'additional_input_paths': [ + '<(generate_native_test_stamp)', + ], + 'additional_res_dirs': [ + '<(generator_intermediate_dir)/res', + ], + }, + 'actions': [ + { + 'action_name': 'apk_<(test_suite_name)', + 'message': 'Building <(test_suite_name) test apk.', + 'inputs': [ + '<(DEPTH)/testing/android/AndroidManifest.xml', + '<(DEPTH)/testing/android/generate_native_test.py', + '<(input_shlib_path)', + '>@(input_jars_paths)', + ], + 'outputs': [ + '<(generate_native_test_stamp)', + '<(android_manifest_path)', + ], + 'action': [ + '<(DEPTH)/testing/android/generate_native_test.py', + '--native_library', + '<(input_shlib_path)', + '--output', + '<(generator_intermediate_dir)', + '--strip-binary=<(android_strip)', + '--app_abi', + '<(android_app_abi)', + '--stamp-file', + '<(generate_native_test_stamp)', + '--no-compile', + ], + }, + ], + 'includes': [ 'java_apk.gypi' ], + }], # 'OS == "android" and gtest_target_type == "shared_library" + ], # conditions } diff --git a/build/java_apk.gypi b/build/java_apk.gypi index f200b16..c3c9241 100644 --- a/build/java_apk.gypi +++ b/build/java_apk.gypi @@ -64,6 +64,7 @@ 'jar_name': 'chromium_apk_<(_target_name).jar', 'resource_dir%':'<(DEPTH)/build/android/ant/empty/res', 'R_package%':'', + 'additional_R_text_files': [], 'additional_res_dirs': [], 'additional_res_packages': [], 'is_test_apk%': 0, @@ -96,11 +97,12 @@ 'jar_path': '<(PRODUCT_DIR)/lib.java/<(jar_name)', 'obfuscated_jar_path': '<(intermediate_dir)/obfuscated.jar', 'dex_path': '<(intermediate_dir)/classes.dex', - 'android_manifest': '<(java_in_dir)/AndroidManifest.xml', + 'android_manifest_path%': '<(java_in_dir)/AndroidManifest.xml', 'push_stamp': '<(intermediate_dir)/push.stamp', 'link_stamp': '<(intermediate_dir)/link.stamp', 'codegen_input_paths': [], - 'final_apk_path': '<(PRODUCT_DIR)/apks/<(apk_name).apk', + 'final_apk_path%': '<(PRODUCT_DIR)/apks/<(apk_name).apk', + 'source_dir': '<(java_in_dir)/src', 'apk_install_stamp': '<(intermediate_dir)/apk_install.stamp', 'apk_package_native_libs_dir': '<(intermediate_dir)/libs', }, @@ -340,7 +342,7 @@ '<(DEPTH)/build/android/ant/apk-codegen.xml', '<(DEPTH)/build/android/gyp/util/build_utils.py', '<(DEPTH)/build/android/gyp/ant.py', - '<(android_manifest)', + '<(android_manifest_path)', '>@(library_manifest_paths)' '>@(codegen_input_paths)', '>@(additional_input_paths)', @@ -354,7 +356,7 @@ '-DADDITIONAL_RES_DIRS=>(additional_res_dirs)', '-DADDITIONAL_RES_PACKAGES=>(additional_res_packages)', '-DADDITIONAL_R_TEXT_FILES=>(additional_R_text_files)', - '-DANDROID_MANIFEST=<(android_manifest)', + '-DANDROID_MANIFEST=<(android_manifest_path)', '-DANDROID_SDK_JAR=<(android_sdk_jar)', '-DANDROID_SDK_ROOT=<(android_sdk_root)', '-DANDROID_SDK_VERSION=<(android_sdk_version)', @@ -550,17 +552,17 @@ '-DANDROID_SDK_JAR=<(android_sdk_jar)', '-DANDROID_SDK_ROOT=<(android_sdk_root)', '-DANDROID_SDK_VERSION=<(android_sdk_version)', - '-DAPKS_DIR=<(PRODUCT_DIR)/apks', '-DAPK_NAME=<(apk_name)', '-DAPP_MANIFEST_VERSION_CODE=<(app_manifest_version_code)', '-DAPP_MANIFEST_VERSION_NAME=<(app_manifest_version_name)', '-DASSET_DIR=<(asset_location)', '-DCONFIGURATION_NAME=<(CONFIGURATION_NAME)', + '-DFINAL_APK_PATH=<(final_apk_path)', '-DKEYSTORE_PATH=<(DEPTH)/build/android/ant/chromium-debug.keystore', '-DNATIVE_LIBS_DIR=<(apk_package_native_libs_dir)', '-DOUT_DIR=<(intermediate_dir)', '-DRESOURCE_DIR=<(resource_dir)', - '-DSOURCE_DIR=<(java_in_dir)/src', + '-DSOURCE_DIR=<(source_dir)', '-Dbasedir=.', '-buildfile', |