diff options
author | nileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-25 20:17:49 +0000 |
---|---|---|
committer | nileshagrawal@chromium.org <nileshagrawal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-25 20:17:49 +0000 |
commit | a44d12100141c09e8cbb73d19fdf11a6febd0148 (patch) | |
tree | e27a7d73a435b13f65851452b2d0bdec1cb24de2 /base/base.gyp | |
parent | 1a695bc286bb24e8c7ba213cae5923c8558b2f1b (diff) | |
download | chromium_src-a44d12100141c09e8cbb73d19fdf11a6febd0148.zip chromium_src-a44d12100141c09e8cbb73d19fdf11a6febd0148.tar.gz chromium_src-a44d12100141c09e8cbb73d19fdf11a6febd0148.tar.bz2 |
Add APK targets for content_unittests and net_unittests.
- Add a gyp template to simplify adding new targets.
- Add support for multiple jars in the test APK.
BUG=125059
TEST=
Review URL: https://chromiumcodereview.appspot.com/10399126
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139106 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/base.gyp')
-rw-r--r-- | base/base.gyp | 47 |
1 files changed, 10 insertions, 37 deletions
diff --git a/base/base.gyp b/base/base.gyp index 99c826c..60fa8ab 100644 --- a/base/base.gyp +++ b/base/base.gyp @@ -312,7 +312,7 @@ 'android/jni_generator/jni_generator.gyp:jni_generator_tests', ], 'conditions': [ - ['"<(gtest_target_type)"=="shared_library"', { + ['gtest_target_type == "shared_library"', { 'dependencies': [ '../testing/android/native_test.gyp:native_test_native_code', ], @@ -643,54 +643,27 @@ }, ], }], - # Special target to wrap a <(gtest_target_type)==shared_library + # Special target to wrap a gtest_target_type == shared_library # base_unittests into an android apk for execution. # TODO(jrg): lib.target comes from _InstallableTargetInstallPath() # in the gyp make generator. What is the correct way to extract # this path from gyp and into 'raw' for input to antfiles? # Hard-coding in the gypfile seems a poor choice. - # TODO(jrg): there has to be a shorter way to do all this. Try - # and convert this entire target cluster into ~5 lines that can be - # trivially copied to other projects with only a deps change, such - # as with a new gtest_target_type called - # 'shared_library_apk_wrapper' that does a lot of this magically. - ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { + ['OS == "android" and gtest_target_type == "shared_library"', { 'targets': [ { 'target_name': 'base_unittests_apk', 'type': 'none', 'dependencies': [ - 'base', # So that android/java/java.gyp:base_java is built + 'base_java', 'base_unittests', ], - 'actions': [ - { - # Generate apk files (including source and antfile) from - # a template, and builds them. - 'action_name': 'generate_and_build', - 'inputs': [ - '../testing/android/AndroidManifest.xml', - '../testing/android/generate_native_test.py', - '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', - '<(PRODUCT_DIR)/lib.java/chromium_base.jar' - ], - 'outputs': [ - '<(PRODUCT_DIR)/base_unittests_apk/base_unittests-debug.apk', - ], - 'action': [ - '../testing/android/generate_native_test.py', - '--native_library', - '<(PRODUCT_DIR)/lib.target/libbase_unittests.so', - '--jar', - '<(PRODUCT_DIR)/lib.java/chromium_base.jar', - '--output', - '<(PRODUCT_DIR)/base_unittests_apk', - '--ant-args', - '-DPRODUCT_DIR=<(PRODUCT_DIR)', - '--ant-compile' - ], - }, - ] + 'variables': { + 'test_suite_name': 'base_unittests', + 'input_shlib_path': '<(PRODUCT_DIR)/lib.target/<(SHARED_LIB_PREFIX)base_unittests<(SHARED_LIB_SUFFIX)', + 'input_jars_paths': ['<(PRODUCT_DIR)/lib.java/chromium_base.jar',], + }, + 'includes': [ '../build/apk_test.gypi' ], }], }], ], |