michael@0: # Copyright (c) 2012 The Chromium Authors. All rights reserved. michael@0: # Use of this source code is governed by a BSD-style license that can be michael@0: # found in the LICENSE file. michael@0: michael@0: # This file is meant to be included into a target to provide a rule michael@0: # to build APK based test suites. michael@0: # michael@0: # To use this, create a gyp target with the following form: michael@0: # { michael@0: # 'target_name': 'test_suite_name_apk', michael@0: # 'type': 'none', michael@0: # 'variables': { michael@0: # 'test_suite_name': 'test_suite_name', # string michael@0: # 'input_shlib_path' : '/path/to/test_suite.so', # string michael@0: # 'input_jars_paths': ['/path/to/test_suite.jar', ... ], # list michael@0: # }, michael@0: # 'includes': ['path/to/this/gypi/file'], michael@0: # } michael@0: # michael@0: michael@0: { michael@0: 'variables': { michael@0: 'input_jars_paths': [ michael@0: # Needed by ChromeNativeTestActivity.java. michael@0: '<(PRODUCT_DIR)/lib.java/chromium_base.jar', michael@0: ], michael@0: }, michael@0: 'target_conditions': [ michael@0: ['_toolset == "target"', { michael@0: 'conditions': [ michael@0: ['OS == "android" and gtest_target_type == "shared_library"', { michael@0: 'actions': [{ michael@0: 'action_name': 'apk_<(test_suite_name)', michael@0: 'message': 'Building <(test_suite_name) test apk.', michael@0: 'inputs': [ michael@0: '<(DEPTH)/testing/android/AndroidManifest.xml', michael@0: '<(DEPTH)/testing/android/generate_native_test.py', michael@0: '<(input_shlib_path)', michael@0: '>@(input_jars_paths)', michael@0: ], michael@0: 'outputs': [ michael@0: '<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk', michael@0: ], michael@0: 'action': [ michael@0: '<(DEPTH)/testing/android/generate_native_test.py', michael@0: '--native_library', michael@0: '<(input_shlib_path)', michael@0: '--jars', michael@0: '">@(input_jars_paths)"', michael@0: '--output', michael@0: '<(PRODUCT_DIR)/<(test_suite_name)_apk', michael@0: '--strip-binary=<(android_strip)', michael@0: '--app_abi', michael@0: '<(android_app_abi)', michael@0: '--ant-args', michael@0: '-DPRODUCT_DIR=<(ant_build_out)', michael@0: '--ant-args', michael@0: '-DANDROID_SDK=<(android_sdk)', michael@0: '--ant-args', michael@0: '-DANDROID_SDK_ROOT=<(android_sdk_root)', michael@0: '--ant-args', michael@0: '-DANDROID_SDK_TOOLS=<(android_sdk_tools)', michael@0: '--ant-args', michael@0: '-DANDROID_SDK_VERSION=<(android_sdk_version)', michael@0: '--ant-args', michael@0: '-DANDROID_GDBSERVER=<(android_gdbserver)', michael@0: '--ant-args', michael@0: '-DCHROMIUM_SRC=<(ant_build_out)/../..', michael@0: ], michael@0: }], michael@0: }], # 'OS == "android" and gtest_target_type == "shared_library" michael@0: ], # conditions michael@0: }], michael@0: ], # target_conditions michael@0: }