Revert "Merged all Chromoting Host code into remoting_core.dll (Windows)."
[chromium-blink-merge.git] / testing / android / native_test.gyp
blob06f72793f509bd5cc9b9f46b4b12cf260a7cc338
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.
6   'conditions': [
7     ['OS=="android"', {
8       'targets': [
9         {
10           'target_name': 'native_test_apk',
11           'message': 'building native test apk',
12           'type': 'none',
13           'dependencies': [
14             'native_test_native_code',
15             '<(DEPTH)/base/base.gyp:base_java',
16           ],
17           'actions': [
18             {
19               'action_name': 'native_test_apk',
20               'inputs': [
21                 '<(DEPTH)/testing/android/native_test_apk.xml',
22                 '<!@(find <(DEPTH)/testing/android -name "*.java")',
23                 '>@(input_jars_paths)',
24                 'native_test_launcher.cc'
25               ],
26               'outputs': [
27                 # Awkwardly, we build a Debug APK even when gyp is in
28                 # Release mode.  I don't think it matters (e.g. we're
29                 # probably happy to not codesign) but naming should be
30                 # fixed.  The -debug name is an aspect of the android
31                 # SDK antfiles (e.g. ${sdk.dir}/tools/ant/build.xml)
32                 '<(PRODUCT_DIR)/replaceme_apk/replaceme-debug.apk',
33               ],
34               'action': [
35                 'ant', '-q',
36                 # TODO: All of these paths are absolute paths right now, while
37                 # we really should be using relative paths for anything that is
38                 # checked in to the Chromium tree (among which the SDK).
39                 '-DPRODUCT_DIR=<(ant_build_out)',
40                 '-DANDROID_SDK=<(android_sdk)',
41                 '-DANDROID_SDK_ROOT=<(android_sdk_root)',
42                 '-DANDROID_SDK_TOOLS=<(android_sdk_tools)',
43                 '-DANDROID_SDK_VERSION=<(android_sdk_version)',
44                 '-DANDROID_GDBSERVER=<(android_gdbserver)',
45                 '-DCHROMIUM_SRC=<(ant_build_out)/../..',
46                 '-DINPUT_JARS_PATHS=>(input_jars_paths)',
47                 '-buildfile',
48                 '<(DEPTH)/testing/android/native_test_apk.xml',
49               ]
50             }
51           ],
52         },
53         {
54           'target_name': 'native_test_native_code',
55           'message': 'building native pieces of native test package',
56           'type': 'static_library',
57           'sources': [
58             'native_test_launcher.cc',
59           ],
60           'direct_dependent_settings': {
61             'ldflags!': [
62               # JNI_OnLoad is implemented in a .a and we need to
63               # re-export in the .so.
64               '-Wl,--exclude-libs=ALL',
65             ],
66           },
67           'dependencies': [
68             '../../base/base.gyp:base',
69             '../../base/base.gyp:test_support_base',
70             '../gtest.gyp:gtest',
71             'native_test_jni_headers',
72           ],
73         },
74         {
75           'target_name': 'native_test_jni_headers',
76           'type': 'none',
77           'sources': [
78             'java/src/org/chromium/native_test/ChromeNativeTestActivity.java'
79           ],
80           'variables': {
81             'jni_gen_dir': 'testing',
82           },
83           'includes': [ '../../build/jni_generator.gypi' ],
84           # So generated jni headers can be found by targets that
85           # depend on this.
86           'direct_dependent_settings': {
87             'include_dirs': [
88               '<(SHARED_INTERMEDIATE_DIR)',
89             ],
90           },
91         },
92       ],
93     }]
94   ],