James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 1 | # Copyright 2014 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. |
| 4 | |
Aaron Boodman | a10f671 | 2014-10-23 10:01:51 -0700 | [diff] [blame] | 5 | import("//build/config/ui.gni") |
Aaron Boodman | f9b1d79 | 2014-10-23 13:35:57 -0700 | [diff] [blame] | 6 | import("//mojo/public/mojo.gni") |
Aaron Boodman | b34bcbf | 2015-03-02 10:05:31 -0800 | [diff] [blame] | 7 | import("//mojo/public/mojo_application.gni") |
Aaron Boodman | f9b1d79 | 2014-10-23 13:35:57 -0700 | [diff] [blame] | 8 | import("//mojo/public/tools/bindings/mojom.gni") |
Benjamin Lerman | dc3d193 | 2015-03-09 11:17:39 +0100 | [diff] [blame] | 9 | import("//mojo/tools/embed/rules.gni") |
James Robinson | 5e66a79 | 2015-01-21 17:02:08 -0800 | [diff] [blame] | 10 | import("//testing/test.gni") |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 11 | |
James Robinson | 1d53271 | 2014-11-03 14:50:36 -0800 | [diff] [blame] | 12 | # We don't support building in the component build since mojo apps are |
| 13 | # inherently components. |
| 14 | assert(!is_component_build) |
| 15 | |
James Robinson | b4b7af2 | 2014-12-05 11:21:01 -0800 | [diff] [blame] | 16 | group("shell") { |
| 17 | testonly = true |
| 18 | |
| 19 | deps = [ |
Dale Sather | 958af74 | 2016-01-06 13:59:32 -0800 | [diff] [blame] | 20 | ":copy_symbols", |
James Robinson | b4b7af2 | 2014-12-05 11:21:01 -0800 | [diff] [blame] | 21 | ":mojo_shell", |
| 22 | ":tests", |
| 23 | ] |
| 24 | |
Benjamin Lerman | fbbee73 | 2014-12-08 17:05:48 +0100 | [diff] [blame] | 25 | if (is_android) { |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 26 | deps += [ |
| 27 | ":mojo_shell_apk", |
Benjamin Lerman | 2cb6237 | 2015-01-22 13:25:11 +0100 | [diff] [blame] | 28 | ":mojo_shell_tests_apk", |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 29 | ] |
Benjamin Lerman | fbbee73 | 2014-12-08 17:05:48 +0100 | [diff] [blame] | 30 | } |
James Robinson | b4b7af2 | 2014-12-05 11:21:01 -0800 | [diff] [blame] | 31 | } |
| 32 | |
| 33 | group("tests") { |
| 34 | testonly = true |
| 35 | deps = [ |
James Robinson | 25dfab2 | 2015-08-24 15:20:18 -0700 | [diff] [blame] | 36 | ":apptests", |
James Robinson | b4b7af2 | 2014-12-05 11:21:01 -0800 | [diff] [blame] | 37 | ":mojo_shell_tests", |
Andrew Wilson | 7d0e795 | 2015-06-29 11:21:09 -0700 | [diff] [blame] | 38 | ":shell_nfc_apptests", |
Przemysław Pietrzkiewicz | 6384d09 | 2015-01-15 16:03:17 -0800 | [diff] [blame] | 39 | "//shell/application_manager:mojo_application_manager_unittests", |
James Robinson | b4b7af2 | 2014-12-05 11:21:01 -0800 | [diff] [blame] | 40 | ] |
James Robinson | 04362ac | 2015-09-18 18:24:02 -0700 | [diff] [blame] | 41 | |
craig stout | 34776a7 | 2015-10-22 08:17:33 -0700 | [diff] [blame] | 42 | # TODO(cstout): fix breakpad build for fnl/musl |
| 43 | # https://code.google.com/p/google-breakpad/issues/detail?id=631 |
| 44 | if ((is_android || is_linux) && !is_fnl) { |
James Robinson | 04362ac | 2015-09-18 18:24:02 -0700 | [diff] [blame] | 45 | deps += [ "//shell/crash:crash_unittests" ] |
| 46 | } |
James Robinson | b4b7af2 | 2014-12-05 11:21:01 -0800 | [diff] [blame] | 47 | } |
| 48 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 49 | if (is_android) { |
| 50 | import("//build/config/android/config.gni") |
| 51 | import("//build/config/android/rules.gni") |
| 52 | } |
| 53 | |
Scott Violet | 912f52f | 2015-03-26 07:30:24 -0700 | [diff] [blame] | 54 | if (!mojo_use_prebuilt_mojo_shell) { |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 55 | shell_common_deps = [ |
Viet-Trung Luu | 988b4be | 2015-05-15 13:00:15 -0700 | [diff] [blame] | 56 | ":parent_lib", |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 57 | "//base", |
| 58 | "//base/allocator", |
| 59 | "//build/config/sanitizers:deps", |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 60 | "//mojo/environment:chromium", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 61 | "//mojo/message_pump", |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 62 | ] |
| 63 | shell_common_data_deps = [ ":mojo_shell_child" ] |
Aaron Boodman | f9b1d79 | 2014-10-23 13:35:57 -0700 | [diff] [blame] | 64 | |
craig stout | 34776a7 | 2015-10-22 08:17:33 -0700 | [diff] [blame] | 65 | # TODO(cstout): fix breakpad build for fnl/musl |
| 66 | # (see comment above) |
| 67 | if ((is_android || is_linux) && !is_fnl) { |
James Robinson | 04362ac | 2015-09-18 18:24:02 -0700 | [diff] [blame] | 68 | shell_common_deps += [ "//shell/crash" ] |
| 69 | } |
| 70 | |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 71 | if (is_android) { |
| 72 | shared_library("mojo_shell") { |
| 73 | sources = [ |
Benjamin Lerman | 5308b71 | 2014-12-12 17:52:00 +0100 | [diff] [blame] | 74 | "android/library_loader.cc", |
Viet-Trung Luu | 7cc1466 | 2015-03-30 11:06:27 -0700 | [diff] [blame] | 75 | "android/main.cc", |
| 76 | "android/main.h", |
Benjamin Lerman | 5308b71 | 2014-12-12 17:52:00 +0100 | [diff] [blame] | 77 | ] |
| 78 | |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 79 | deps = shell_common_deps + [ |
| 80 | ":jni_headers", |
cdotstout | c45263e | 2015-09-21 13:41:21 -0700 | [diff] [blame] | 81 | "//gpu/config", |
James Robinson | 2725728 | 2015-04-16 17:11:15 -0700 | [diff] [blame] | 82 | "//mojo/android:libsystem_java", |
Benjamin Lerman | 11bc605 | 2015-11-13 17:10:48 +0100 | [diff] [blame] | 83 | "//mojo/common", |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 84 | "//services/native_viewport:lib", |
Benjamin Lerman | ed52cc1 | 2016-03-30 09:30:49 +0200 | [diff] [blame] | 85 | "//services/ui/launcher:bindings", |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 86 | "//shell/application_manager", |
| 87 | "//ui/gl", |
| 88 | ] |
Benjamin Lerman | 5308b71 | 2014-12-12 17:52:00 +0100 | [diff] [blame] | 89 | |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 90 | data_deps = shell_common_data_deps |
| 91 | } |
| 92 | } else { |
| 93 | executable("mojo_shell") { |
| 94 | sources = [ |
| 95 | "desktop/main.cc", |
Benjamin Lerman | 5308b71 | 2014-12-12 17:52:00 +0100 | [diff] [blame] | 96 | ] |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 97 | |
Sean Klein | a7ffbe0 | 2015-09-15 17:30:28 -0700 | [diff] [blame] | 98 | deps = shell_common_deps + [ ":mojo_shell_child_32_bit" ] |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 99 | |
| 100 | data_deps = shell_common_data_deps |
Benjamin Lerman | 5308b71 | 2014-12-12 17:52:00 +0100 | [diff] [blame] | 101 | } |
James Robinson | 8bcf28e | 2014-12-03 17:39:48 -0800 | [diff] [blame] | 102 | } |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 103 | |
| 104 | executable("mojo_shell_child") { |
| 105 | sources = [ |
| 106 | "child_main.cc", |
| 107 | ] |
| 108 | |
| 109 | deps = [ |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 110 | ":child_controller_bindings", |
Viet-Trung Luu | dd63a38 | 2015-04-08 16:03:57 -0700 | [diff] [blame] | 111 | ":common_lib", |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 112 | "//base", |
| 113 | "//base/allocator", |
| 114 | "//build/config/sanitizers:deps", |
Viet-Trung Luu | 1da183c | 2015-11-18 15:41:35 -0800 | [diff] [blame] | 115 | "//mojo/edk/base_edk", |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 116 | "//mojo/edk/system", |
| 117 | "//mojo/environment:chromium", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 118 | "//mojo/message_pump", |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 119 | ] |
| 120 | } |
Sean Klein | a7ffbe0 | 2015-09-15 17:30:28 -0700 | [diff] [blame] | 121 | |
| 122 | if (current_cpu == "x86") { |
| 123 | # The 32-bit version of the mojo_shell_child should be accessible in the |
| 124 | # root build directory, just like the regular mojo_shell_child, so that |
| 125 | # the 32-bit version can be accessed by simply adding a suffix to the path. |
| 126 | copy("mojo_shell_child_32_bit_copy") { |
| 127 | sources = [ |
| 128 | "${root_out_dir}/mojo_shell_child", |
| 129 | ] |
| 130 | outputs = [ |
| 131 | "${root_build_dir}/mojo_shell_child_32", |
| 132 | ] |
| 133 | deps = [ |
| 134 | ":mojo_shell_child", |
| 135 | ] |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | group("mojo_shell_child_32_bit") { |
| 140 | # This group is required to run any 32-bit child process. |
| 141 | deps = [] |
Craig Stout | 0e7c2c3 | 2015-09-17 15:14:08 -0700 | [diff] [blame] | 142 | if ((target_cpu == "x64" || target_cpu == "x86") && is_linux && !is_fnl) { |
Sean Klein | a7ffbe0 | 2015-09-15 17:30:28 -0700 | [diff] [blame] | 143 | # The toolchain is hardcoded as 32-bit clang here -- although it must |
| 144 | # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would |
| 145 | # be defined as the 32 bit variant of whatever is being used (be it clang, |
| 146 | # gcc, or something else). |
| 147 | deps = [ |
| 148 | ":mojo_shell_child_32_bit_copy(//build/toolchain/linux:clang_x86)", |
| 149 | ] |
| 150 | } |
| 151 | } |
Scott Violet | 912f52f | 2015-03-26 07:30:24 -0700 | [diff] [blame] | 152 | } # !mojo_use_prebuilt_mojo_shell |
Aaron Boodman | f9b1d79 | 2014-10-23 13:35:57 -0700 | [diff] [blame] | 153 | |
Viet-Trung Luu | dd63a38 | 2015-04-08 16:03:57 -0700 | [diff] [blame] | 154 | # Files used both by mojo_shell and mojo_shell_child (and tests). |
| 155 | source_set("common_lib") { |
Chris Masone | 246b59b | 2014-12-01 15:43:53 -0800 | [diff] [blame] | 156 | sources = [ |
Viet-Trung Luu | 988b4be | 2015-05-15 13:00:15 -0700 | [diff] [blame] | 157 | "child_switches.cc", |
| 158 | "child_switches.h", |
Chris Masone | 246b59b | 2014-12-01 15:43:53 -0800 | [diff] [blame] | 159 | "init.cc", |
| 160 | "init.h", |
| 161 | ] |
| 162 | |
| 163 | deps = [ |
| 164 | "//base", |
| 165 | ] |
Viet-Trung Luu | dd63a38 | 2015-04-08 16:03:57 -0700 | [diff] [blame] | 166 | |
| 167 | public_deps = [ |
| 168 | ":native_application_support", |
Viet-Trung Luu | dd63a38 | 2015-04-08 16:03:57 -0700 | [diff] [blame] | 169 | ] |
Chris Masone | 246b59b | 2014-12-01 15:43:53 -0800 | [diff] [blame] | 170 | } |
| 171 | |
Viet-Trung Luu | 988b4be | 2015-05-15 13:00:15 -0700 | [diff] [blame] | 172 | source_set("parent_lib") { |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 173 | sources = [ |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 174 | "background_application_loader.cc", |
| 175 | "background_application_loader.h", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 176 | "child_process_host.cc", |
| 177 | "child_process_host.h", |
Benjamin Lerman | 4fc210c | 2014-12-18 18:18:06 +0100 | [diff] [blame] | 178 | "command_line_util.cc", |
| 179 | "command_line_util.h", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 180 | "context.cc", |
| 181 | "context.h", |
James Robinson | 24218d7 | 2014-10-20 16:18:41 -0700 | [diff] [blame] | 182 | "filename_util.cc", |
| 183 | "filename_util.h", |
Viet-Trung Luu | 463c4d7 | 2015-04-08 14:55:01 -0700 | [diff] [blame] | 184 | "in_process_native_runner.cc", |
| 185 | "in_process_native_runner.h", |
Viet-Trung Luu | 47e2e35 | 2015-03-04 16:38:18 -0800 | [diff] [blame] | 186 | "out_of_process_native_runner.cc", |
| 187 | "out_of_process_native_runner.h", |
Viet-Trung Luu | 988b4be | 2015-05-15 13:00:15 -0700 | [diff] [blame] | 188 | "switches.cc", |
| 189 | "switches.h", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 190 | "task_runners.cc", |
| 191 | "task_runners.h", |
James Robinson | f0f1860 | 2015-04-10 11:29:47 -0700 | [diff] [blame] | 192 | "tracer.cc", |
| 193 | "tracer.h", |
Nick Bray | f54e465 | 2015-03-12 17:07:42 -0700 | [diff] [blame] | 194 | "url_resolver.cc", |
| 195 | "url_resolver.h", |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 196 | "url_response_disk_cache_loader.cc", |
| 197 | "url_response_disk_cache_loader.h", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 198 | ] |
| 199 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 200 | deps = [ |
Viet-Trung Luu | f09c0d9 | 2015-04-01 14:38:57 -0700 | [diff] [blame] | 201 | ":child_controller_bindings", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 202 | "//base", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 203 | "//base:base_static", |
Dale Sather | 958af74 | 2016-01-06 13:59:32 -0800 | [diff] [blame] | 204 | "//base/third_party/dynamic_annotations", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 205 | "//mojo/application", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 206 | "//mojo/common", |
James Robinson | 85ccf05 | 2014-12-01 16:31:03 -0800 | [diff] [blame] | 207 | "//mojo/common:tracing_impl", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 208 | "//mojo/data_pipe_utils", |
Viet-Trung Luu | 1da183c | 2015-11-18 15:41:35 -0800 | [diff] [blame] | 209 | "//mojo/edk/base_edk", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 210 | "//mojo/edk/system", |
James Robinson | a600ca5 | 2014-11-21 13:13:55 -0800 | [diff] [blame] | 211 | "//mojo/public/cpp/bindings", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 212 | "//mojo/public/interfaces/application", |
Viet-Trung Luu | 2e11a3f | 2015-10-13 13:20:30 -0700 | [diff] [blame] | 213 | "//mojo/services/network/interfaces", |
Viet-Trung Luu | 0f4f3ba | 2015-10-10 01:08:40 -0700 | [diff] [blame] | 214 | "//mojo/services/tracing/interfaces", |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 215 | "//services/url_response_disk_cache", |
Benjamin Lerman | f87cd45 | 2015-06-26 14:29:23 +0200 | [diff] [blame] | 216 | "//shell/application_manager", |
James Robinson | 85ccf05 | 2014-12-01 16:31:03 -0800 | [diff] [blame] | 217 | "//url", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 218 | ] |
| 219 | |
Scott Violet | ef1cb8c | 2015-03-13 14:01:39 -0700 | [diff] [blame] | 220 | public_deps = [ |
Viet-Trung Luu | dd63a38 | 2015-04-08 16:03:57 -0700 | [diff] [blame] | 221 | ":common_lib", |
Scott Violet | ef1cb8c | 2015-03-13 14:01:39 -0700 | [diff] [blame] | 222 | ] |
| 223 | |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 224 | if (is_android) { |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 225 | sources += [ |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 226 | "android/android_handler.cc", |
Scott Violet | bc1184a | 2014-12-16 08:55:34 -0800 | [diff] [blame] | 227 | "android/android_handler.h", |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 228 | "android/android_handler_loader.cc", |
Scott Violet | bc1184a | 2014-12-16 08:55:34 -0800 | [diff] [blame] | 229 | "android/android_handler_loader.h", |
Benjamin Lerman | f212dd4 | 2015-06-22 15:10:46 +0200 | [diff] [blame] | 230 | "android/java_application_loader.cc", |
| 231 | "android/java_application_loader.h", |
Benjamin Lerman | e15069c | 2015-11-18 13:59:29 +0100 | [diff] [blame] | 232 | "android/native_handler_thread.cc", |
| 233 | "android/native_handler_thread.h", |
Scott Violet | c5399f8 | 2014-12-17 07:59:05 -0800 | [diff] [blame] | 234 | "android/native_viewport_application_loader.cc", |
| 235 | "android/native_viewport_application_loader.h", |
Scott Violet | bc1184a | 2014-12-16 08:55:34 -0800 | [diff] [blame] | 236 | "android/ui_application_loader_android.cc", |
| 237 | "android/ui_application_loader_android.h", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 238 | "android/url_response_disk_cache_delegate_impl.cc", |
| 239 | "android/url_response_disk_cache_delegate_impl.h", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 240 | ] |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 241 | |
| 242 | deps += [ |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 243 | ":jni_headers", |
Przemyslaw Pietrzkiewicz | 78ab413 | 2014-12-03 16:49:32 +0100 | [diff] [blame] | 244 | ":run_android_application_function", |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 245 | "//mojo/application:content_handler", |
Viet-Trung Luu | 08e339a | 2015-10-10 01:03:09 -0700 | [diff] [blame] | 246 | "//mojo/services/content_handler/interfaces", |
Viet-Trung Luu | 84765c4 | 2015-10-10 01:07:51 -0700 | [diff] [blame] | 247 | "//mojo/services/gpu/interfaces", |
| 248 | "//mojo/services/native_viewport/interfaces", |
James Robinson | c9b163e | 2014-12-03 13:31:32 -0800 | [diff] [blame] | 249 | "//services/gles2", |
| 250 | "//services/native_viewport:lib", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 251 | ] |
| 252 | } |
James Robinson | 04362ac | 2015-09-18 18:24:02 -0700 | [diff] [blame] | 253 | |
| 254 | if (is_mac) { |
| 255 | sources -= [ |
| 256 | "url_response_disk_cache_loader.cc", |
| 257 | "url_response_disk_cache_loader.h", |
| 258 | ] |
| 259 | |
| 260 | deps -= [ "//services/url_response_disk_cache" ] |
| 261 | } |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 262 | } |
| 263 | |
Viet-Trung Luu | 463c4d7 | 2015-04-08 14:55:01 -0700 | [diff] [blame] | 264 | # This is a separate target mainly since it suppresses check_includes. |
| 265 | # TODO(vtl): Make it so that the suppression isn't needed. |
Viet-Trung Luu | e126c86 | 2015-03-30 19:20:45 -0700 | [diff] [blame] | 266 | source_set("native_application_support") { |
| 267 | sources = [ |
| 268 | "native_application_support.cc", |
| 269 | "native_application_support.h", |
Forrest Reiling | 74b0cac | 2016-03-02 16:21:15 -0800 | [diff] [blame] | 270 | "platform_handle_impl.cc", |
Viet-Trung Luu | e126c86 | 2015-03-30 19:20:45 -0700 | [diff] [blame] | 271 | ] |
| 272 | |
| 273 | public_deps = [ |
| 274 | "//mojo/public/cpp/bindings", |
| 275 | ] |
| 276 | |
| 277 | deps = [ |
| 278 | "//base", |
James Robinson | aec09ca | 2015-08-24 10:37:59 -0700 | [diff] [blame] | 279 | "//mojo/gles2:control_thunks", |
| 280 | "//mojo/gles2:gles2", |
James Robinson | 1e96a13 | 2015-08-13 13:08:17 -0700 | [diff] [blame] | 281 | "//mojo/gles2:mgl", |
Forrest Reiling | 74b0cac | 2016-03-02 16:21:15 -0800 | [diff] [blame] | 282 | "//mojo/public/platform/native:platform_handle_api", |
Viet-Trung Luu | e126c86 | 2015-03-30 19:20:45 -0700 | [diff] [blame] | 283 | ] |
| 284 | |
| 285 | # This target has to include the public thunk headers, which generally |
| 286 | # shouldn't be included without picking an implementation. We are providing |
| 287 | # the implementation but the thunk header target cannot declare that we are |
| 288 | # permitted to include it since it's in the public SDK and we are not. |
| 289 | # Suppress include checking so we can still check the rest of the targets in |
| 290 | # this file. |
| 291 | check_includes = false |
| 292 | } |
| 293 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 294 | if (is_android) { |
| 295 | generate_jni("jni_headers") { |
| 296 | sources = [ |
Benjamin Lerman | ada6138 | 2014-12-19 16:05:51 +0100 | [diff] [blame] | 297 | "android/apk/src/org/chromium/mojo/shell/AndroidHandler.java", |
| 298 | "android/apk/src/org/chromium/mojo/shell/Bootstrap.java", |
Benjamin Lerman | f212dd4 | 2015-06-22 15:10:46 +0200 | [diff] [blame] | 299 | "android/apk/src/org/chromium/mojo/shell/JavaApplicationRegistry.java", |
Benjamin Lerman | e15069c | 2015-11-18 13:59:29 +0100 | [diff] [blame] | 300 | "android/apk/src/org/chromium/mojo/shell/NativeHandlerThread.java", |
Etienne Membrives | d262745 | 2015-08-05 15:42:53 +0200 | [diff] [blame] | 301 | "android/apk/src/org/chromium/mojo/shell/ShellService.java", |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 302 | "android/tests/src/org/chromium/mojo/shell/ShellTestBase.java", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 303 | ] |
Scott Violet | bc1184a | 2014-12-16 08:55:34 -0800 | [diff] [blame] | 304 | jni_package = "mojo/shell" |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 305 | } |
| 306 | |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 307 | android_library("bootstrap_java") { |
Benjamin Lerman | ada6138 | 2014-12-19 16:05:51 +0100 | [diff] [blame] | 308 | java_files = [ "android/apk/src/org/chromium/mojo/shell/Bootstrap.java" ] |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 309 | |
| 310 | deps = [ |
| 311 | "//base:base_java", |
| 312 | ] |
| 313 | |
| 314 | dex_path = "$target_out_dir/bootstrap_java.dex.jar" |
| 315 | } |
| 316 | |
| 317 | shared_library("bootstrap") { |
| 318 | sources = [ |
| 319 | "android/bootstrap.cc", |
| 320 | ] |
| 321 | deps = [ |
| 322 | ":jni_headers", |
Przemyslaw Pietrzkiewicz | 78ab413 | 2014-12-03 16:49:32 +0100 | [diff] [blame] | 323 | ":run_android_application_function", |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 324 | "//base", |
Przemyslaw Pietrzkiewicz | 78ab413 | 2014-12-03 16:49:32 +0100 | [diff] [blame] | 325 | ] |
| 326 | } |
| 327 | |
| 328 | # Shared header between the bootstrap and the main shell .so. |
| 329 | source_set("run_android_application_function") { |
| 330 | sources = [ |
| 331 | "android/run_android_application_function.h", |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 332 | ] |
Scott Violet | c5399f8 | 2014-12-17 07:59:05 -0800 | [diff] [blame] | 333 | |
| 334 | deps = [ |
| 335 | "//base", |
| 336 | ] |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 337 | } |
| 338 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 339 | android_library("java") { |
| 340 | java_files = [ |
Benjamin Lerman | 9842dd7 | 2015-11-24 16:33:21 +0100 | [diff] [blame] | 341 | "android/apk/src/org/chromium/mojo/shell/AndroidFactory.java", |
Benjamin Lerman | ada6138 | 2014-12-19 16:05:51 +0100 | [diff] [blame] | 342 | "android/apk/src/org/chromium/mojo/shell/AndroidHandler.java", |
Benjamin Lerman | 7a6f76b | 2015-11-02 15:24:04 +0100 | [diff] [blame] | 343 | "android/apk/src/org/chromium/mojo/shell/BaseActivity.java", |
Benjamin Lerman | ada6138 | 2014-12-19 16:05:51 +0100 | [diff] [blame] | 344 | "android/apk/src/org/chromium/mojo/shell/FileHelper.java", |
Benjamin Lerman | 785958d | 2015-11-12 15:11:11 +0100 | [diff] [blame] | 345 | "android/apk/src/org/chromium/mojo/shell/InputFactory.java", |
Etienne Membrives | e190705 | 2015-08-13 14:17:07 +0200 | [diff] [blame] | 346 | "android/apk/src/org/chromium/mojo/shell/IntentReceiverActivity.java", |
Benjamin Lerman | 1a8ef40 | 2015-04-08 13:47:49 +0200 | [diff] [blame] | 347 | "android/apk/src/org/chromium/mojo/shell/IntentReceiverRegistry.java", |
Benjamin Lerman | f212dd4 | 2015-06-22 15:10:46 +0200 | [diff] [blame] | 348 | "android/apk/src/org/chromium/mojo/shell/JavaApplicationRegistry.java", |
| 349 | "android/apk/src/org/chromium/mojo/shell/KeyboardFactory.java", |
Benjamin Lerman | ada6138 | 2014-12-19 16:05:51 +0100 | [diff] [blame] | 350 | "android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java", |
| 351 | "android/apk/src/org/chromium/mojo/shell/MojoShellApplication.java", |
Benjamin Lerman | e15069c | 2015-11-18 13:59:29 +0100 | [diff] [blame] | 352 | "android/apk/src/org/chromium/mojo/shell/NativeHandlerThread.java", |
Etienne Membrives | fbd9af0 | 2015-08-07 16:26:09 +0200 | [diff] [blame] | 353 | "android/apk/src/org/chromium/mojo/shell/NativeViewportSupportApplicationDelegate.java", |
Andrew Wilson | 7d0e795 | 2015-06-29 11:21:09 -0700 | [diff] [blame] | 354 | "android/apk/src/org/chromium/mojo/shell/NfcApplicationDelegate.java", |
| 355 | "android/apk/src/org/chromium/mojo/shell/NfcDbManager.java", |
| 356 | "android/apk/src/org/chromium/mojo/shell/NfcImpl.java", |
| 357 | "android/apk/src/org/chromium/mojo/shell/NfcReceiverActivity.java", |
| 358 | "android/apk/src/org/chromium/mojo/shell/NfcServiceFactoryBinder.java", |
P.Y. Laligand | e9d96fe | 2015-07-15 11:11:10 -0700 | [diff] [blame] | 359 | "android/apk/src/org/chromium/mojo/shell/SharingActivity.java", |
| 360 | "android/apk/src/org/chromium/mojo/shell/SharingApplicationDelegate.java", |
Etienne Membrives | d262745 | 2015-08-05 15:42:53 +0200 | [diff] [blame] | 361 | "android/apk/src/org/chromium/mojo/shell/ShellService.java", |
Etienne Membrives | fbd9af0 | 2015-08-07 16:26:09 +0200 | [diff] [blame] | 362 | "android/apk/src/org/chromium/mojo/shell/ViewportActivity.java", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 363 | ] |
| 364 | |
| 365 | deps = [ |
Andrew Wilson | d433573 | 2015-06-16 12:36:22 -0700 | [diff] [blame] | 366 | ":resources", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 367 | "//base:base_java", |
James Robinson | 2725728 | 2015-04-16 17:11:15 -0700 | [diff] [blame] | 368 | "//mojo/android:system_java", |
Benjamin Lerman | f212dd4 | 2015-06-22 15:10:46 +0200 | [diff] [blame] | 369 | "//mojo/public/interfaces/application:application_java", |
| 370 | "//mojo/public/java:application", |
Benjamin Lerman | 56e1705 | 2015-04-22 13:59:00 +0200 | [diff] [blame] | 371 | "//mojo/public/java:bindings", |
James Robinson | 2725728 | 2015-04-16 17:11:15 -0700 | [diff] [blame] | 372 | "//mojo/public/java:system", |
Benjamin Lerman | 9842dd7 | 2015-11-24 16:33:21 +0100 | [diff] [blame] | 373 | "//mojo/services/android/interfaces:interfaces_java", |
Benjamin Lerman | 785958d | 2015-11-12 15:11:11 +0100 | [diff] [blame] | 374 | "//mojo/services/input/interfaces:interfaces_java", |
Viet-Trung Luu | 84765c4 | 2015-10-10 01:07:51 -0700 | [diff] [blame] | 375 | "//mojo/services/keyboard/interfaces:interfaces_java", |
Benjamin Lerman | 785958d | 2015-11-12 15:11:11 +0100 | [diff] [blame] | 376 | "//mojo/services/nfc/interfaces:interfaces_java", |
Benjamin Lerman | 9842dd7 | 2015-11-24 16:33:21 +0100 | [diff] [blame] | 377 | "//services/android", |
Benjamin Lerman | a6fb7a2 | 2015-09-08 13:48:28 +0200 | [diff] [blame] | 378 | "//services/authentication", |
Benjamin Lerman | 785958d | 2015-11-12 15:11:11 +0100 | [diff] [blame] | 379 | "//services/input", |
Benjamin Lerman | f212dd4 | 2015-06-22 15:10:46 +0200 | [diff] [blame] | 380 | "//services/intent_receiver:bindings_java", |
Benjamin Lerman | 785958d | 2015-11-12 15:11:11 +0100 | [diff] [blame] | 381 | "//services/keyboard", |
| 382 | "//services/location", |
Etienne Membrives | fbd9af0 | 2015-08-07 16:26:09 +0200 | [diff] [blame] | 383 | "//services/native_viewport:interfaces_java", |
Benjamin Lerman | 785958d | 2015-11-12 15:11:11 +0100 | [diff] [blame] | 384 | "//services/native_viewport:native_viewport_java", |
Andrew Wilson | 7d0e795 | 2015-06-29 11:21:09 -0700 | [diff] [blame] | 385 | "//services/nfc_message_sink:bindings_java", |
P.Y. Laligand | e9d96fe | 2015-07-15 11:11:10 -0700 | [diff] [blame] | 386 | "//services/sharing_sink:bindings_java", |
Benjamin Lerman | 7a6f76b | 2015-11-02 15:24:04 +0100 | [diff] [blame] | 387 | "//third_party/android_tools:android_support_v13_java", |
Benjamin Lerman | e880985 | 2016-02-17 19:47:04 +0100 | [diff] [blame] | 388 | "//ui/gl:gl_java", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 389 | ] |
| 390 | } |
| 391 | |
Etienne Membrives | 2c315ae | 2015-06-02 13:16:25 +0200 | [diff] [blame] | 392 | if (is_official_build) { |
| 393 | icon_dir = "android/apk/res-official" |
| 394 | } else { |
| 395 | icon_dir = "android/apk/res-dev" |
| 396 | } |
| 397 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 398 | android_resources("resources") { |
Etienne Membrives | 2c315ae | 2015-06-02 13:16:25 +0200 | [diff] [blame] | 399 | resource_dirs = [ |
| 400 | "android/apk/res", |
| 401 | icon_dir, |
| 402 | ] |
Benjamin Lerman | ada6138 | 2014-12-19 16:05:51 +0100 | [diff] [blame] | 403 | custom_package = "org.chromium.mojo.shell" |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 404 | } |
| 405 | |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 406 | mojo_shell_assets_dir = "$root_build_dir/mojo_shell_assets" |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 407 | mojo_shell_test_assets_dir = "$root_build_dir/mojo_shell_test_assets" |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 408 | |
| 409 | copy_ex("copy_mojo_shell_assets") { |
| 410 | clear_dir = true |
| 411 | dest = mojo_shell_assets_dir |
| 412 | sources = [ |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 413 | "$root_out_dir/exe.stripped/mojo_shell_child", |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 414 | "$root_out_dir/lib.stripped/libbootstrap.so", |
Przemyslaw Pietrzkiewicz | 170449d | 2014-12-11 11:00:01 +0100 | [diff] [blame] | 415 | "$root_out_dir/network_service.mojo", |
Benjamin Lerman | 6f06292 | 2014-12-09 15:20:54 +0100 | [diff] [blame] | 416 | "$root_out_dir/obj/shell/bootstrap_java.dex.jar", |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 417 | ] |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 418 | deps = [ |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 419 | ":bootstrap", |
| 420 | ":bootstrap_java", |
Dale Sather | 958af74 | 2016-01-06 13:59:32 -0800 | [diff] [blame] | 421 | ":mojo_shell_child", |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 422 | "//mojo/public/tools:copy_network_service", |
| 423 | ] |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 424 | |
| 425 | if (!is_debug) { |
| 426 | sources += [ |
| 427 | "$root_out_dir/authenticating_url_loader_interceptor.mojo", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 428 | "$root_out_dir/compositor_service.mojo", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 429 | "$root_out_dir/dart_content_handler.mojo", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 430 | "$root_out_dir/files.mojo", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 431 | "$root_out_dir/icu_data.mojo", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 432 | "$root_out_dir/input_manager_service.mojo", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 433 | "$root_out_dir/java_handler.mojo", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 434 | "$root_out_dir/launcher.mojo", |
| 435 | "$root_out_dir/speech_recognizer.mojo", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 436 | "$root_out_dir/tracing.mojo", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 437 | "$root_out_dir/view_manager_service.mojo", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 438 | ] |
| 439 | |
| 440 | deps += [ |
| 441 | "//services/authenticating_url_loader_interceptor", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 442 | "//services/dart:dart_content_handler", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 443 | "//services/files", |
| 444 | "//services/gfx/compositor", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 445 | "//services/icu_data", |
Dale Sather | 958af74 | 2016-01-06 13:59:32 -0800 | [diff] [blame] | 446 | "//services/java_handler", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 447 | "//services/speech_recognizer", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 448 | "//services/tracing", |
Benjamin Lerman | 352cf9f | 2016-03-21 15:08:58 +0100 | [diff] [blame] | 449 | "//services/ui/input_manager", |
| 450 | "//services/ui/launcher", |
| 451 | "//services/ui/view_manager", |
Benjamin Lerman | c440c74 | 2015-09-28 13:52:53 +0200 | [diff] [blame] | 452 | ] |
| 453 | } |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 454 | } |
| 455 | |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 456 | copy_ex("copy_mojo_shell_test_assets") { |
| 457 | clear_dir = true |
| 458 | dest = mojo_shell_test_assets_dir |
| 459 | sources = [ |
| 460 | "$root_out_dir/test_app.mojo", |
| 461 | "$root_out_dir/test_request_tracker_app.mojo", |
| 462 | ] |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 463 | deps = [ |
| 464 | "//services/test_service:test_app", |
| 465 | "//services/test_service:test_request_tracker_app", |
| 466 | ] |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 467 | } |
| 468 | |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 469 | if (!is_official_build) { |
| 470 | manifest_package = "org.chromium.mojo.shell" |
| 471 | apk_name = "Mojo Shell (dev)" |
Benjamin Lerman | 3b02af6 | 2015-11-12 15:46:00 +0100 | [diff] [blame] | 472 | debuggable = "true" |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 473 | } else { |
Etienne Membrives | 7988866 | 2015-06-17 13:00:21 +0200 | [diff] [blame] | 474 | manifest_package = "io.mojoapps.launcher" |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 475 | apk_name = "Mojo Shell" |
Benjamin Lerman | 3b02af6 | 2015-11-12 15:46:00 +0100 | [diff] [blame] | 476 | debuggable = "false" |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 477 | } |
| 478 | |
Etienne Membrives | 54b7b1a | 2015-06-01 15:20:33 +0200 | [diff] [blame] | 479 | if (is_official_build) { |
| 480 | # Force GN to re-generate ninja files when a new commit is present. |
| 481 | read_file("//.git/index", "") |
| 482 | version_code = |
| 483 | exec_script("//mojo/public/tools/gn/last_commit_timestamp.py", |
| 484 | [ |
| 485 | "--directory", |
| 486 | rebase_path("//", root_build_dir), |
| 487 | ], |
| 488 | "trim string") |
Etienne Membrives | 7988866 | 2015-06-17 13:00:21 +0200 | [diff] [blame] | 489 | |
| 490 | # Download the keystore for signing. |
| 491 | keystore_path = "$root_build_dir/mojo_shell-official.keystore" |
| 492 | action("download_keystore") { |
| 493 | script = "//mojo/tools/download_keystore.py" |
| 494 | outputs = [ |
| 495 | keystore_path, |
| 496 | ] |
Etienne Membrives | 3f27499 | 2015-06-18 18:55:07 +0200 | [diff] [blame] | 497 | args = [ |
| 498 | "keystore_file", |
| 499 | rebase_path(keystore_path, root_build_dir), |
| 500 | ] |
Etienne Membrives | 7988866 | 2015-06-17 13:00:21 +0200 | [diff] [blame] | 501 | } |
Etienne Membrives | 3f27499 | 2015-06-18 18:55:07 +0200 | [diff] [blame] | 502 | keystore_password = exec_script("//mojo/tools/download_keystore.py", |
| 503 | [ "keystore_password" ], |
| 504 | "trim string") |
Etienne Membrives | 54b7b1a | 2015-06-01 15:20:33 +0200 | [diff] [blame] | 505 | } else { |
| 506 | version_code = "1" |
| 507 | } |
| 508 | version_name = "0.0.1" |
| 509 | |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 510 | jinja_variables = [ |
| 511 | "manifest_package=$manifest_package", |
| 512 | "apk_name=$apk_name", |
Benjamin Lerman | 3b02af6 | 2015-11-12 15:46:00 +0100 | [diff] [blame] | 513 | "debuggable=$debuggable", |
Etienne Membrives | 54b7b1a | 2015-06-01 15:20:33 +0200 | [diff] [blame] | 514 | "version_code=$version_code", |
| 515 | "version_name=$version_name", |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 516 | ] |
| 517 | |
| 518 | mojo_shell_manifest = |
| 519 | "$target_gen_dir/mojo_shell_manifest/AndroidManifest.xml" |
| 520 | |
| 521 | jinja_template("mojo_shell_manifest") { |
| 522 | variables = jinja_variables |
| 523 | input = "android/apk/AndroidManifest.xml.jinja2" |
| 524 | output = mojo_shell_manifest |
| 525 | } |
| 526 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 527 | android_apk("mojo_shell_apk") { |
| 528 | apk_name = "MojoShell" |
| 529 | |
Etienne Membrives | 0ebb0e6 | 2015-06-01 09:46:42 +0200 | [diff] [blame] | 530 | android_manifest = mojo_shell_manifest |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 531 | |
James Robinson | 8bcf28e | 2014-12-03 17:39:48 -0800 | [diff] [blame] | 532 | native_libs = [ "libmojo_shell.so" ] |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 533 | |
Benjamin Lerman | 2cb6237 | 2015-01-22 13:25:11 +0100 | [diff] [blame] | 534 | asset_location = mojo_shell_assets_dir |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 535 | |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 536 | deps = [ |
Przemyslaw Pietrzkiewicz | 168bb12 | 2014-11-25 20:15:15 +0100 | [diff] [blame] | 537 | ":copy_mojo_shell_assets", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 538 | ":java", |
Benjamin Lerman | 8e4554d | 2015-04-13 23:47:21 +0200 | [diff] [blame] | 539 | ":mojo_shell", |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 540 | ":mojo_shell_manifest", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 541 | ":resources", |
James Robinson | 5e66a79 | 2015-01-21 17:02:08 -0800 | [diff] [blame] | 542 | "//base:base_java", |
James Robinson | c9b163e | 2014-12-03 13:31:32 -0800 | [diff] [blame] | 543 | "//services/native_viewport:native_viewport_java", |
Alhaad Gokhale | 08a3543 | 2015-03-10 12:41:33 -0700 | [diff] [blame] | 544 | "//third_party/android_tools:google_play_services_default_resources", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 545 | ] |
Etienne Membrives | 7988866 | 2015-06-17 13:00:21 +0200 | [diff] [blame] | 546 | |
| 547 | if (is_official_build) { |
| 548 | deps += [ ":download_keystore" ] |
| 549 | keystore_path = keystore_path |
| 550 | keystore_name = "official" |
| 551 | keystore_password = keystore_password |
| 552 | } |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 553 | } |
Benjamin Lerman | 7d036f0 | 2014-12-23 10:39:19 +0100 | [diff] [blame] | 554 | |
| 555 | android_library("mojo_shell_tests_java") { |
| 556 | java_files = |
| 557 | [ "android/tests/src/org/chromium/mojo/shell/ShellTestBase.java" ] |
| 558 | |
| 559 | deps = [ |
| 560 | ":java", |
| 561 | "//base:base_java", |
| 562 | ] |
| 563 | } |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 564 | } |
| 565 | |
Viet-Trung Luu | f09c0d9 | 2015-04-01 14:38:57 -0700 | [diff] [blame] | 566 | mojom("child_controller_bindings") { |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 567 | sources = [ |
Viet-Trung Luu | f09c0d9 | 2015-04-01 14:38:57 -0700 | [diff] [blame] | 568 | "child_controller.mojom", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 569 | ] |
Przemyslaw Pietrzkiewicz | a121d2c | 2015-01-27 18:27:02 +0100 | [diff] [blame] | 570 | |
| 571 | deps = [ |
| 572 | "//mojo/public/interfaces/application", |
| 573 | ] |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 574 | } |
| 575 | |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 576 | test("mojo_shell_tests") { |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 577 | sources = [ |
Benjamin Lerman | 5d429aa | 2015-05-07 16:21:00 +0200 | [diff] [blame] | 578 | "background_application_loader_unittest.cc", |
Viet-Trung Luu | 2cdfa55 | 2015-04-01 14:27:43 -0700 | [diff] [blame] | 579 | "child_process_host_unittest.cc", |
Benjamin Lerman | 4fc210c | 2014-12-18 18:18:06 +0100 | [diff] [blame] | 580 | "command_line_util_unittest.cc", |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 581 | "context_unittest.cc", |
Viet-Trung Luu | 47e2e35 | 2015-03-04 16:38:18 -0800 | [diff] [blame] | 582 | "in_process_native_runner_unittest.cc", |
Aaron Boodman | 5e7f904 | 2015-02-24 17:37:34 -0800 | [diff] [blame] | 583 | "native_runner_unittest.cc", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 584 | "shell_test_base.cc", |
| 585 | "shell_test_base.h", |
Nick Bray | f54e465 | 2015-03-12 17:07:42 -0700 | [diff] [blame] | 586 | "shell_test_base_android.cc", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 587 | "shell_test_base_unittest.cc", |
| 588 | "shell_test_main.cc", |
Dave Moore | 2a897b0 | 2015-02-10 11:44:32 -0800 | [diff] [blame] | 589 | "url_resolver_unittest.cc", |
Dave Moore | c972832 | 2014-10-23 20:55:51 -0700 | [diff] [blame] | 590 | ] |
| 591 | |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 592 | deps = [ |
Viet-Trung Luu | 988b4be | 2015-05-15 13:00:15 -0700 | [diff] [blame] | 593 | ":parent_lib", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 594 | "//base", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 595 | "//base:i18n", |
Dale Sather | 958af74 | 2016-01-06 13:59:32 -0800 | [diff] [blame] | 596 | "//base/test:test_support", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 597 | "//mojo/common", |
| 598 | "//mojo/edk/system", |
| 599 | "//mojo/environment:chromium", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 600 | "//mojo/message_pump", |
James Robinson | a600ca5 | 2014-11-21 13:13:55 -0800 | [diff] [blame] | 601 | "//mojo/public/cpp/bindings", |
James Robinson | 63b637a | 2014-12-03 14:46:39 -0800 | [diff] [blame] | 602 | "//services/test_service:bindings", |
Przemysław Pietrzkiewicz | 6384d09 | 2015-01-15 16:03:17 -0800 | [diff] [blame] | 603 | "//shell/application_manager", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 604 | "//testing/gtest", |
| 605 | "//url", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 606 | ] |
| 607 | |
Viet-Trung Luu | e0a4a18 | 2015-04-07 16:28:01 -0700 | [diff] [blame] | 608 | data_deps = [ |
| 609 | ":mojo_shell_child", |
James Robinson | 63b637a | 2014-12-03 14:46:39 -0800 | [diff] [blame] | 610 | "//services/test_service:test_app", |
| 611 | "//services/test_service:test_request_tracker_app", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 612 | ] |
| 613 | |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 614 | if (is_android) { |
Benjamin Lerman | 2cb6237 | 2015-01-22 13:25:11 +0100 | [diff] [blame] | 615 | deps += [ ":jni_headers" ] |
| 616 | |
| 617 | apk_deps = [ |
James Robinson | 5e66a79 | 2015-01-21 17:02:08 -0800 | [diff] [blame] | 618 | ":copy_mojo_shell_test_assets", |
| 619 | ":mojo_shell_tests_java", |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 620 | ] |
James Robinson | 5e66a79 | 2015-01-21 17:02:08 -0800 | [diff] [blame] | 621 | |
Benjamin Lerman | 2cb6237 | 2015-01-22 13:25:11 +0100 | [diff] [blame] | 622 | apk_asset_location = mojo_shell_test_assets_dir |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 623 | } |
| 624 | } |
| 625 | |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 626 | # Shared library propagation will happen up to executable, shared library, |
| 627 | # or complete static library boundaries. |
| 628 | # Workaround from brettw to prevent gn from linking pingable app into the |
| 629 | # apptests executable. |
| 630 | static_library("pingable_app_dummy") { |
| 631 | complete_static_lib = true |
| 632 | testonly = true |
| 633 | public_deps = [ |
| 634 | "//shell/test:pingable_app($default_toolchain)", |
| 635 | ] |
James Robinson | 04362ac | 2015-09-18 18:24:02 -0700 | [diff] [blame] | 636 | sources = [ |
| 637 | "pingable_app_dummy_empty.cc", |
| 638 | ] |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 639 | } |
| 640 | |
Benjamin Lerman | dc3d193 | 2015-03-09 11:17:39 +0100 | [diff] [blame] | 641 | embed_file("embed_pingable") { |
| 642 | source = "$root_build_dir/pingable_app.mojo" |
Viet-Trung Luu | bd07e3a | 2015-04-09 12:43:29 -0700 | [diff] [blame] | 643 | namespace = "shell::test" |
Benjamin Lerman | dc3d193 | 2015-03-09 11:17:39 +0100 | [diff] [blame] | 644 | variable = "kPingable" |
| 645 | testonly = true |
Benjamin Lerman | dc3d193 | 2015-03-09 11:17:39 +0100 | [diff] [blame] | 646 | deps = [ |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 647 | ":pingable_app_dummy", |
Benjamin Lerman | dc3d193 | 2015-03-09 11:17:39 +0100 | [diff] [blame] | 648 | ] |
| 649 | } |
| 650 | |
Aaron Boodman | b34bcbf | 2015-03-02 10:05:31 -0800 | [diff] [blame] | 651 | mojo_native_application("apptests") { |
| 652 | output_name = "shell_apptests" |
| 653 | |
| 654 | testonly = true |
| 655 | |
| 656 | sources = [ |
| 657 | "shell_apptest.cc", |
| 658 | ] |
| 659 | |
| 660 | deps = [ |
Dale Sather | 958af74 | 2016-01-06 13:59:32 -0800 | [diff] [blame] | 661 | ":embed_pingable", |
Aaron Boodman | b34bcbf | 2015-03-02 10:05:31 -0800 | [diff] [blame] | 662 | "//base", |
| 663 | "//mojo/application", |
| 664 | "//mojo/application:test_support", |
James Robinson | c4d0fb2 | 2016-01-28 14:31:21 -0800 | [diff] [blame] | 665 | "//mojo/converters/base", |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 666 | "//mojo/data_pipe_utils", |
Aaron Boodman | b34bcbf | 2015-03-02 10:05:31 -0800 | [diff] [blame] | 667 | "//mojo/public/cpp/bindings:callback", |
| 668 | "//mojo/public/cpp/environment", |
| 669 | "//mojo/public/cpp/system:system", |
Viet-Trung Luu | 199850d | 2015-11-16 15:20:58 -0800 | [diff] [blame] | 670 | "//mojo/public/interfaces/application", |
Viet-Trung Luu | 84765c4 | 2015-10-10 01:07:51 -0700 | [diff] [blame] | 671 | "//mojo/services/http_server/cpp", |
| 672 | "//mojo/services/http_server/interfaces", |
Viet-Trung Luu | fe25adb | 2016-04-28 10:33:45 -0700 | [diff] [blame] | 673 | "//mojo/services/http_server/interfaces:interfaces_sync", |
Viet-Trung Luu | 2e11a3f | 2015-10-13 13:20:30 -0700 | [diff] [blame] | 674 | "//mojo/services/network/interfaces", |
Aaron Boodman | b34bcbf | 2015-03-02 10:05:31 -0800 | [diff] [blame] | 675 | "//shell/test:bindings", |
| 676 | ] |
| 677 | |
Benjamin Lerman | 7a6f76b | 2015-11-02 15:24:04 +0100 | [diff] [blame] | 678 | data_deps = [ |
| 679 | "//services/http_server:http_server($default_toolchain)", |
| 680 | ] |
Aaron Boodman | b34bcbf | 2015-03-02 10:05:31 -0800 | [diff] [blame] | 681 | } |
Andrew Wilson | 7d0e795 | 2015-06-29 11:21:09 -0700 | [diff] [blame] | 682 | |
| 683 | mojo_native_application("shell_nfc_apptests") { |
| 684 | output_name = "shell_nfc_apptests" |
| 685 | |
| 686 | testonly = true |
| 687 | |
| 688 | sources = [ |
| 689 | "android/nfc_apptest.cc", |
| 690 | ] |
| 691 | |
| 692 | deps = [ |
| 693 | "//base", |
| 694 | "//mojo/application", |
| 695 | "//mojo/application:test_support", |
| 696 | "//mojo/common:common", |
| 697 | "//mojo/public/cpp/bindings:callback", |
| 698 | "//mojo/public/cpp/environment", |
| 699 | "//mojo/public/cpp/system:system", |
Viet-Trung Luu | 0f4f3ba | 2015-10-10 01:08:40 -0700 | [diff] [blame] | 700 | "//mojo/services/nfc/interfaces", |
Andrew Wilson | 7d0e795 | 2015-06-29 11:21:09 -0700 | [diff] [blame] | 701 | "//shell/test:bindings", |
| 702 | ] |
| 703 | } |
Benjamin Lerman | f961e5e | 2015-07-16 11:43:38 +0200 | [diff] [blame] | 704 | |
| 705 | copy("copy_symbols") { |
| 706 | testonly = true |
| 707 | |
| 708 | deps = [ |
| 709 | ":mojo_shell", |
Craig Stout | 677be22 | 2015-08-04 15:15:18 -0700 | [diff] [blame] | 710 | ":mojo_shell_child", |
Benjamin Lerman | f961e5e | 2015-07-16 11:43:38 +0200 | [diff] [blame] | 711 | ] |
| 712 | if (is_android) { |
| 713 | deps += [ ":bootstrap" ] |
| 714 | } |
| 715 | |
| 716 | sources = [ |
| 717 | "${root_out_dir}/mojo_shell_child", |
| 718 | ] |
| 719 | if (is_android) { |
| 720 | sources += [ |
| 721 | "${root_out_dir}/libbootstrap.so", |
| 722 | "${root_out_dir}/libmojo_shell.so", |
| 723 | ] |
| 724 | } else { |
| 725 | sources += [ "${root_out_dir}/mojo_shell" ] |
| 726 | } |
| 727 | |
| 728 | outputs = [ |
| 729 | "${root_out_dir}/symbols/{{source_file_part}}", |
| 730 | ] |
| 731 | } |