Quench build spew.
[chromium-blink-merge.git] / build / apk_test.gypi
blob4fd3db552c334f07bf537c49f1b0d0dda5afa874
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5 # This file is meant to be included into a target to provide a rule
6 # to build APK based test suites.
8 # To use this, create a gyp target with the following form:
9 # {
10 #   'target_name': 'test_suite_name_apk',
11 #   'type': 'none',
12 #   'variables': {
13 #     'test_suite_name': 'test_suite_name',  # string
14 #     'input_shlib_path' : '/path/to/test_suite.so',  # string
15 #     'input_jars_paths': ['/path/to/test_suite.jar', ... ],  # list
16 #   },
17 #   'includes': ['path/to/this/gypi/file'],
18 # }
22   'dependencies': [
23     '<(DEPTH)/base/base.gyp:base_java',
24     '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
25   ],
26   'variables': {
27     'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk/',
28     'generate_native_test_stamp': '<(intermediate_dir)/generate_native_test.stamp',
29   },
30   'target_conditions': [
31     ['_toolset == "target"', {
32       'conditions': [
33         ['OS == "android" and gtest_target_type == "shared_library"', {
34           'actions': [{
35             'action_name': 'apk_<(test_suite_name)',
36             'message': 'Building <(test_suite_name) test apk.',
37             'inputs': [
38               '<(DEPTH)/testing/android/AndroidManifest.xml',
39               '<(DEPTH)/testing/android/generate_native_test.py',
40               '<(input_shlib_path)',
41               '>@(input_jars_paths)',
42             ],
43             'outputs': [
44               '<(generate_native_test_stamp)',
45             ],
46             'action': [
47               '<(DEPTH)/testing/android/generate_native_test.py',
48               '--native_library',
49               '<(input_shlib_path)',
50               '--output',
51               '<(intermediate_dir)',
52               '--strip-binary=<(android_strip)',
53               '--app_abi',
54               '<(android_app_abi)',
55               '--stamp-file',
56               '<(generate_native_test_stamp)',
57               '--no-compile',
58             ],
59           },
60           {
61             'action_name': 'ant_apk_<(test_suite_name)',
62             'message': 'Building <(test_suite_name) test apk.',
63             'inputs': [
64               '<(generate_native_test_stamp)',
65             ],
66             'outputs': [
67               '<(PRODUCT_DIR)/<(test_suite_name)_apk/<(test_suite_name)-debug.apk',
68             ],
69             'action': [
70               'ant', '-quiet',
71               '-DPRODUCT_DIR=<(ant_build_out)',
72               '-DANDROID_SDK=<(android_sdk)',
73               '-DANDROID_SDK_ROOT=<(android_sdk_root)',
74               '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
75               '-DANDROID_SDK_VERSION=<(android_sdk_version)',
76               '-DANDROID_GDBSERVER=<(android_gdbserver)',
77               '-DCHROMIUM_SRC=<(ant_build_out)/../..',
78               '-DINPUT_JARS_PATHS=>(input_jars_paths)',
79               '-DAPP_ABI=<(android_app_abi)',
80               '-buildfile', '<(intermediate_dir)/native_test_apk.xml',
81             ],
82           }],
83         }],  # 'OS == "android" and gtest_target_type == "shared_library"
84       ],  # conditions
85     }],
86   ],  # target_conditions