Index: ipc/ipc.gyp |
diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp |
index 9b38f77aaf2fcf0d28820cb9d53b8d4a93d5e07b..1c9d552875f1f6c235743bbc54636c49730b7be9 100644 |
--- a/ipc/ipc.gyp |
+++ b/ipc/ipc.gyp |
@@ -32,7 +32,7 @@ |
'targets': [ |
{ |
'target_name': 'ipc_tests', |
- 'type': 'executable', |
+ 'type': '<(gtest_target_type)', |
'dependencies': [ |
'ipc', |
'../base/base.gyp:base', |
@@ -63,6 +63,11 @@ |
'../build/linux/system.gyp:gtk', |
], |
}], |
+ ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { |
+ 'dependencies': [ |
+ '../testing/android/native_test.gyp:native_test_native_code', |
+ ], |
+ }], |
['os_posix == 1 and OS != "mac" and OS != "android"', { |
'conditions': [ |
['linux_use_tcmalloc==1', { |
@@ -87,4 +92,48 @@ |
], |
}, |
], |
+ 'conditions': [ |
+ # Special target to wrap a <(gtest_target_type)==shared_library |
+ # ipc_tests into an android apk for execution. |
+ # See base.gyp for TODO(jrg)s about this strategy. |
+ ['OS=="android" and "<(gtest_target_type)"=="shared_library"', { |
+ 'targets': [ |
+ { |
+ 'target_name': 'ipc_tests_apk', |
+ 'type': 'none', |
+ 'dependencies': [ |
+ 'ipc_tests', |
+ ], |
+ 'actions': [ |
+ { |
+ # Generate apk files (including source and antfile) from |
+ # a template, and builds them. |
+ 'action_name': 'generate_and_build', |
+ 'inputs': [ |
+ '../testing/android/generate_native_test.py', |
+ '<(PRODUCT_DIR)/lib.target/libipc_tests.so', |
+ '<(PRODUCT_DIR)/chromium_base.jar' |
+ ], |
+ 'outputs': [ |
+ '<(PRODUCT_DIR)/ChromeNativeTests_ipc_tests-debug.apk', |
+ ], |
+ 'action': [ |
+ '../testing/android/generate_native_test.py', |
+ '--native_library', |
+ '<(PRODUCT_DIR)/lib.target/libipc_tests.so', |
+ # TODO(jrg): find a better way to specify jar |
+ # dependencies. Hard coding seems fragile. |
+ '--jar', |
+ '<(PRODUCT_DIR)/chromium_base.jar', |
+ '--output', |
+ '<(PRODUCT_DIR)/ipc_tests_apk', |
+ '--ant-args', |
+ '-DPRODUCT_DIR=<(PRODUCT_DIR)', |
+ '--ant-compile' |
+ ], |
+ }, |
+ ], |
+ }], |
+ }], |
+ ], |
} |