Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: mojo/runner/BUILD.gn

Issue 1130763004: Gets mandoline working on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: get windows working Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 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 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/ui.gni") 5 import("//build/config/ui.gni")
6 import("//mojo/generate_mojo_shell_assets_list.gni")
6 import("//third_party/mojo/src/mojo/public/mojo.gni") 7 import("//third_party/mojo/src/mojo/public/mojo.gni")
7 import("//third_party/mojo/src/mojo/public/mojo_application.gni") 8 import("//third_party/mojo/src/mojo/public/mojo_application.gni")
8 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni") 9 import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
9 import("//testing/test.gni") 10 import("//testing/test.gni")
10 11
11 # We don't support building in the component build since mojo apps are 12 # We don't support building in the component build since mojo apps are
12 # inherently components. 13 # inherently components.
13 assert(!is_component_build) 14 assert(!is_component_build)
14 15
15 group("runner") { 16 group("runner") {
16 testonly = true 17 testonly = true
17 18
18 deps = [ 19 deps = [
19 ":mojo_runner", 20 ":mojo_runner",
20 ] 21 ]
21 22
22 if (is_android) { 23 if (is_android) {
23 deps += [ ":mojo_runner_apk" ] 24 deps += [ ":mojo_runner_apk" ]
24 } 25 }
25 } 26 }
26 27
27 if (is_android) { 28 if (is_android) {
28 import("//build/config/android/config.gni") 29 import("//build/config/android/config.gni")
29 import("//build/config/android/rules.gni") 30 import("//build/config/android/rules.gni")
30 } 31 }
31 32
32 executable("mojo_runner") { 33 source_set("mojo_runner_lib") {
33 sources = [] 34 sources = []
34 35
35 deps = [ 36 deps = [
36 ":lib", 37 ":lib",
37 "//base", 38 "//base",
38 "//build/config/sanitizers:deps", 39 "//build/config/sanitizers:deps",
39 "//mojo/common", 40 "//mojo/common",
40 "//mojo/environment:chromium", 41 "//mojo/environment:chromium",
41 ] 42 ]
42 43
43 if (!is_android) { 44 if (!is_android) {
44 sources += [ 45 sources += [
45 "desktop/launcher_process.cc", 46 "desktop/launcher_process.cc",
46 "desktop/launcher_process.h", 47 "desktop/launcher_process.h",
47 "desktop/main.cc", 48 "desktop/main.cc",
48 ] 49 ]
49 } else { 50 } else {
50 sources += [ 51 sources += [
52 "android/context_init.h",
51 "android/library_loader.cc", 53 "android/library_loader.cc",
52 "android/main.cc", 54 "android/main.cc",
53 "android/main.h", 55 "android/main.h",
54 ] 56 ]
55 57
56 # On android, the executable is also the native library used by the apk.
57 # It means dynamic symbols must be preserved and exported.
58 ldflags = [ "-Wl,--export-dynamic" ]
59
60 deps += [ 58 deps += [
61 ":jni_headers", 59 ":jni_headers",
62 "//components/native_viewport:lib", 60 "//components/native_viewport:lib",
63 "//mojo/shell", 61 "//mojo/shell",
64 "//ui/gl", 62 "//ui/gl",
65 ] 63 ]
66 } 64 }
67 } 65 }
68 66
67 executable("mojo_runner") {
68 deps = [
69 ":mojo_runner_lib",
70 ]
71
72 if (is_android) {
73 sources = [
74 "android/context_init.cc",
75 ]
76
77 # On android, the executable is also the native library used by the apk.
78 # It means dynamic symbols must be preserved and exported.
79 ldflags = [ "-Wl,--export-dynamic" ]
80 }
81 }
82
69 source_set("in_process_native_runner") { 83 source_set("in_process_native_runner") {
70 sources = [ 84 sources = [
71 "in_process_native_runner.cc", 85 "in_process_native_runner.cc",
72 "in_process_native_runner.h", 86 "in_process_native_runner.h",
73 ] 87 ]
74 88
75 public_deps = [ 89 public_deps = [
76 ":native_application_support", 90 ":native_application_support",
77 "//mojo/shell", 91 "//mojo/shell",
78 ] 92 ]
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 android_library("java") { 257 android_library("java") {
244 java_files = [ 258 java_files = [
245 "android/apk/src/org/chromium/mojo/shell/AndroidHandler.java", 259 "android/apk/src/org/chromium/mojo/shell/AndroidHandler.java",
246 "android/apk/src/org/chromium/mojo/shell/FileHelper.java", 260 "android/apk/src/org/chromium/mojo/shell/FileHelper.java",
247 "android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java", 261 "android/apk/src/org/chromium/mojo/shell/MojoShellActivity.java",
248 "android/apk/src/org/chromium/mojo/shell/MojoShellApplication.java", 262 "android/apk/src/org/chromium/mojo/shell/MojoShellApplication.java",
249 "android/apk/src/org/chromium/mojo/shell/ShellMain.java", 263 "android/apk/src/org/chromium/mojo/shell/ShellMain.java",
250 ] 264 ]
251 265
252 deps = [ 266 deps = [
267 ":resources",
253 "//base:base_java", 268 "//base:base_java",
254 ] 269 ]
255 } 270 }
256 271
257 android_resources("resources") { 272 android_resources("resources") {
258 resource_dirs = [ "android/apk/res" ] 273 resource_dirs = [ "android/apk/res" ]
259 custom_package = "org.chromium.mojo.shell" 274 custom_package = "org.chromium.mojo.shell"
260 } 275 }
261 276
262 mojo_runner_assets_dir = "$root_build_dir/mojo_runner_assets" 277 mojo_runner_assets_dir = "$root_build_dir/mojo_runner_assets"
263 mojo_runner_test_assets_dir = "$root_build_dir/mojo_runner_test_assets" 278 mojo_runner_test_assets_dir = "$root_build_dir/mojo_runner_test_assets"
264 279
265 copy_ex("copy_mojo_runner_assets") { 280 copy_ex("copy_mojo_runner_assets") {
266 clear_dir = true 281 clear_dir = true
267 dest = mojo_runner_assets_dir 282 dest = mojo_runner_assets_dir
283 deps = [
284 ":copy_mojo_runner",
285 ]
268 sources = [ 286 sources = [
269 "$root_out_dir/lib.stripped/libbootstrap.so", 287 "$root_out_dir/lib.stripped/libbootstrap.so",
270 "$root_out_dir/network_service.mojo", 288 "$root_out_dir/network_service.mojo",
271 "$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar", 289 "$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar",
272 ] 290 ]
273 } 291 }
274 292
293 generate_mojo_shell_assets_list("build_mojo_runner_assets") {
294 deps = [
295 ":copy_mojo_runner_assets",
296 ]
297 dir = mojo_runner_assets_dir
298 }
299
275 copy("copy_mojo_runner") { 300 copy("copy_mojo_runner") {
276 sources = [ 301 sources = [
277 "$root_out_dir/exe.stripped/mojo_runner", 302 "$root_out_dir/exe.stripped/mojo_runner",
278 ] 303 ]
279 outputs = [ 304 outputs = [
280 "$root_out_dir/lib.stripped/libmojo_runner.so", 305 "$root_out_dir/lib.stripped/libmojo_runner.so",
281 ] 306 ]
282 } 307 }
283 308
284 copy_ex("copy_mojo_runner_test_assets") { 309 copy_ex("copy_mojo_runner_test_assets") {
285 clear_dir = true 310 clear_dir = true
286 dest = mojo_runner_test_assets_dir 311 dest = mojo_runner_test_assets_dir
287 sources = [ 312 sources = [
288 "$root_out_dir/test_app.mojo", 313 "$root_out_dir/test_app.mojo",
289 "$root_out_dir/test_request_tracker_app.mojo", 314 "$root_out_dir/test_request_tracker_app.mojo",
290 ] 315 ]
291 } 316 }
292 317
293 android_apk("mojo_runner_apk") { 318 android_apk("mojo_runner_apk") {
294 apk_name = "MojoRunner" 319 apk_name = "MojoRunner"
295 320
296 android_manifest = "android/apk/AndroidManifest.xml" 321 android_manifest = "android/apk/AndroidManifest.xml"
297 322
298 native_libs = [ "libmojo_runner.so" ] 323 native_libs = [ "libmojo_runner.so" ]
299 324
300 asset_location = mojo_runner_assets_dir 325 asset_location = mojo_runner_assets_dir
301 326
302 deps = [ 327 deps = [
303 ":copy_mojo_runner", 328 ":build_mojo_runner_assets",
304 ":copy_mojo_runner_assets",
305 ":java", 329 ":java",
306 ":resources", 330 ":resources",
307 "//base:base_java", 331 "//base:base_java",
308 "//components/native_viewport:native_viewport_java", 332 "//components/native_viewport:native_viewport_java",
309 "//third_party/android_tools:google_play_services_default_resources", 333 "//third_party/android_tools:google_play_services_default_resources",
310 ] 334 ]
311 } 335 }
312 336
337 generate_mojo_shell_assets_list("build_mojo_runner_test_assets") {
338 deps = [
339 ":copy_mojo_runner_test_assets",
340 ]
341 dir = mojo_runner_test_assets_dir
342 }
343
313 android_library("mojo_runner_tests_java") { 344 android_library("mojo_runner_tests_java") {
314 java_files = 345 java_files =
315 [ "android/tests/src/org/chromium/mojo/shell/ShellTestBase.java" ] 346 [ "android/tests/src/org/chromium/mojo/shell/ShellTestBase.java" ]
316 347
317 deps = [ 348 deps = [
318 ":java", 349 ":java",
319 "//base:base_java", 350 "//base:base_java",
320 ] 351 ]
321 } 352 }
322 } 353 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 "//mojo/services/test_service:test_app", 398 "//mojo/services/test_service:test_app",
368 "//mojo/services/test_service:test_request_tracker_app", 399 "//mojo/services/test_service:test_request_tracker_app",
369 ] 400 ]
370 401
371 if (is_android) { 402 if (is_android) {
372 sources += [ "android/background_application_loader_unittest.cc" ] 403 sources += [ "android/background_application_loader_unittest.cc" ]
373 404
374 deps += [ ":jni_headers" ] 405 deps += [ ":jni_headers" ]
375 406
376 apk_deps = [ 407 apk_deps = [
377 ":copy_mojo_runner_test_assets", 408 ":build_mojo_runner_test_assets",
378 ":mojo_runner_tests_java", 409 ":mojo_runner_tests_java",
379 ] 410 ]
380 411
381 apk_asset_location = mojo_runner_test_assets_dir 412 apk_asset_location = mojo_runner_test_assets_dir
382 } 413 }
383 } 414 }
384 415
385 mojo_native_application("apptests") { 416 mojo_native_application("apptests") {
386 output_name = "runner_apptests" 417 output_name = "runner_apptests"
387 418
(...skipping 15 matching lines...) Expand all
403 #"//mojo/services/http_server/public/interfaces", 434 #"//mojo/services/http_server/public/interfaces",
404 "//mojo/services/network/public/interfaces", 435 "//mojo/services/network/public/interfaces",
405 436
406 "//third_party/mojo/src/mojo/public/cpp/bindings:callback", 437 "//third_party/mojo/src/mojo/public/cpp/bindings:callback",
407 "//third_party/mojo/src/mojo/public/cpp/environment", 438 "//third_party/mojo/src/mojo/public/cpp/environment",
408 "//third_party/mojo/src/mojo/public/cpp/system:system", 439 "//third_party/mojo/src/mojo/public/cpp/system:system",
409 ] 440 ]
410 441
411 #data_deps = [ "//services/http_server:http_server($default_toolchain)" ] 442 #data_deps = [ "//services/http_server:http_server($default_toolchain)" ]
412 } 443 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698