1 # Copyright 2015 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.
7 import("//build/config/android/config.gni")
8 import("//build/config/android/rules.gni")
9 import("//mojo/generate_mojo_shell_assets_list.gni")
11 mandoline_assets_dir = "$root_build_dir/mandoline_assets"
19 executable("mandoline_runner") {
23 "//build/config/sanitizers:deps",
24 "//mandoline/ui/desktop_ui/public/interfaces",
26 "//mojo/environment:chromium",
27 "//mojo/package_manager",
29 "//mojo/runner:mojo_runner_lib",
34 "../core_services_initialization.cc",
35 "mandoline_activity.cc",
36 "mandoline_context_init.cc",
39 # On android, the executable is also the native library used by the apk.
40 # It means dynamic symbols must be preserved and exported.
41 ldflags = [ "-Wl,--export-dynamic" ]
44 copy("copy_mandoline_runner") {
49 "$root_out_dir/mandoline_runner",
52 "$root_shlib_dir/${shlib_prefix}mandoline_runner$shlib_extension",
56 copy_ex("copy_mandoline_assets") {
58 dest = mandoline_assets_dir
60 "//components/devtools_service",
61 "//components/html_viewer",
62 "//components/resource_provider",
63 "//mandoline/services/core_services",
64 "//mojo/runner:bootstrap",
65 "//mojo/runner:bootstrap_java",
66 "//mojo/services/network",
69 "$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar",
70 "$root_shlib_dir/${shlib_prefix}bootstrap$shlib_extension",
73 # Directories can't be specified as sources so pass manually to the script.
75 "--files=" + rebase_path("$root_out_dir/core_services", root_build_dir),
76 "--files=" + rebase_path("$root_out_dir/network_service", root_build_dir),
77 "--files=" + rebase_path("$root_out_dir/resource_provider", root_build_dir),
78 "--files=" + rebase_path("$root_out_dir/devtools_service", root_build_dir),
79 "--files=" + rebase_path("$root_out_dir/html_viewer", root_build_dir),
83 deps += [ "//mandoline/ui" ]
86 "--files=" + rebase_path("$root_out_dir/omnibox", root_build_dir),
87 "--files=" + rebase_path("$root_out_dir/phone_ui", root_build_dir),
92 generate_mojo_shell_assets_list("build_mandoline_assets") {
94 ":copy_mandoline_assets",
96 dir = mandoline_assets_dir
99 android_library("java") {
100 java_files = [ "apk/src/org/chromium/mandoline/MandolineActivity.java" ]
103 "//mojo/runner:java",
108 generate_jni("jni_headers") {
110 "apk/src/org/chromium/mandoline/MandolineActivity.java",
112 jni_package = "mandoline"
115 android_resources("mandoline_apk_resources") {
116 custom_package = "org.chromium.mandoline"
117 resource_dirs = [ "apk/res" ]
120 android_apk("mandoline_apk") {
121 apk_name = "Mandoline"
123 android_manifest = "apk/AndroidManifest.xml"
125 native_libs = [ "${shlib_prefix}mandoline_runner$shlib_extension" ]
127 asset_location = mandoline_assets_dir
130 ":build_mandoline_assets",
131 ":copy_mandoline_runner",
133 ":mandoline_apk_resources",
134 "//mojo/runner:java",
135 "//mojo/runner:resources",
137 "//ui/platform_window/android:platform_window_java",
138 google_play_services_resources,