summaryrefslogtreecommitdiff
path: root/chromium/remoting/android/BUILD.gn
blob: bf0969dd08d7ff04a31f477c89c6c20b932f5bf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//remoting/android/client_java_tmpl.gni")
import("//remoting/android/remoting_apk_tmpl.gni")
import("//remoting/remoting_options.gni")
import("//remoting/tools/build/remoting_localize.gni")

generate_jni("jni_headers") {
  sources = [
    "java/src/org/chromium/chromoting/jni/Client.java",
    "java/src/org/chromium/chromoting/jni/GlDisplay.java",
    "java/src/org/chromium/chromoting/jni/JniInterface.java",
    "java/src/org/chromium/chromoting/jni/TouchEventData.java",
  ]
  jni_package = "remoting"
}

shared_library("remoting_client_jni") {
  deps = [
    "//remoting/android:jni_headers",
    "//remoting/base",
    "//remoting/client",
    "//remoting/client/display",
    "//remoting/protocol",
    "//ui/events:dom_keycode_converter",
    "//ui/gfx",
  ]
  sources = [
    "//remoting/client/audio_player_android.cc",
    "//remoting/client/audio_player_android.h",
    "//remoting/client/jni/android_keymap.cc",
    "//remoting/client/jni/android_keymap.h",
    "//remoting/client/jni/chromoting_jni_instance.cc",
    "//remoting/client/jni/chromoting_jni_instance.h",
    "//remoting/client/jni/chromoting_jni_runtime.cc",
    "//remoting/client/jni/chromoting_jni_runtime.h",
    "//remoting/client/jni/display_updater_factory.h",
    "//remoting/client/jni/egl_thread_context.cc",
    "//remoting/client/jni/egl_thread_context.h",
    "//remoting/client/jni/jni_client.cc",
    "//remoting/client/jni/jni_client.h",
    "//remoting/client/jni/jni_gl_display_handler.cc",
    "//remoting/client/jni/jni_gl_display_handler.h",
    "//remoting/client/jni/jni_pairing_secret_fetcher.cc",
    "//remoting/client/jni/jni_pairing_secret_fetcher.h",
    "//remoting/client/jni/jni_touch_event_data.cc",
    "//remoting/client/jni/jni_touch_event_data.h",
    "//remoting/client/jni/remoting_jni_onload.cc",
    "//remoting/client/jni/remoting_jni_registrar.cc",
    "//remoting/client/jni/remoting_jni_registrar.h",
  ]
  libs = [
    "android",
    "OpenSLES",
    "EGL",
  ]
  configs += [ "//remoting/build/config:enable_webrtc_remoting_client" ]
}

_raw_resources_base_dir = "$target_gen_dir/remoting_android_raw_resources/res"
copy("remoting_android_raw_resources") {
  _credits_html = get_label_info("//remoting/webapp:credits",
                                 "target_gen_dir") + "/credits.html"
  sources = [
    "//remoting/webapp/base/html/credits_css.css",
    "//remoting/webapp/base/html/main.css",
    "//remoting/webapp/base/js/credits_js.js",
    _credits_html,
  ]
  outputs = [
    "$_raw_resources_base_dir/raw/{{source_file_part}}",
  ]
  deps = [
    "//remoting/webapp:credits",
  ]
}

remoting_localize("remoting_apk_manifest") {
  sources = [
    "java/AndroidManifest.xml.jinja2",
  ]
  locales = [ "en" ]
  variables = [ rebase_path(branding_path) ]
  output = "$root_gen_dir/remoting/android/{{source_name_part}}"
}

android_resources("remoting_android_client_java_resources") {
  custom_package = "org.chromium.chromoting"
  resource_dirs = [ "java/res" ]
  generated_resource_dirs = [ _raw_resources_base_dir ]
  generated_resource_files =
      get_target_outputs(":remoting_android_raw_resources")

  deps = [
    ":remoting_android_raw_resources",
    "//remoting/resources:strings_java",
    "//third_party/android_tools:android_support_v7_appcompat_java",
  ]
}

remoting_android_client_java_tmpl("remoting_android_client_java") {
  remoting_google_play_services_library = google_play_services_library
}

remoting_apk_tmpl("remoting_apk") {
  apk_name = "Chromoting"
  java_files = [ "//remoting/android/apk/src/org/chromium/chromoting/RemotingApplication.java" ]
  deps = [
    ":remoting_android_client_java",
    "//base:base_java",
    "//net/android:net_java",
  ]
}

remoting_localize("remoting_test_apk_manifest") {
  sources = [
    "javatests/AndroidManifest.xml.jinja2",
  ]
  locales = [ "en" ]
  variables = [ rebase_path(branding_path) ]
  output = "$root_gen_dir/remoting/android_test/{{source_name_part}}"
}

instrumentation_test_apk("remoting_test_apk") {
  android_manifest = "$root_gen_dir/remoting/android_test/AndroidManifest.xml"
  android_manifest_dep = ":remoting_test_apk_manifest"
  apk_name = "ChromotingTest"
  apk_under_test = ":remoting_apk"
  java_files = [
    "javatests/src/org/chromium/chromoting/EventTest.java",
    "javatests/src/org/chromium/chromoting/MockInputStub.java",
    "javatests/src/org/chromium/chromoting/SwipePinchDetectorTest.java",
    "javatests/src/org/chromium/chromoting/TapGestureDetectorTest.java",
    "javatests/src/org/chromium/chromoting/TouchEventBuilder.java",
    "javatests/src/org/chromium/chromoting/TouchEventGenerator.java",
    "javatests/src/org/chromium/chromoting/TouchInputStrategyTest.java",
    "javatests/src/org/chromium/chromoting/test/util/MutableReference.java",
  ]
  deps = [
    ":remoting_android_client_java",
    "//base:base_java",
    "//base:base_java_test_support",
    "//third_party/android_support_test_runner:runner_java",
  ]
}