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",
28 "//mojo/runner:mojo_runner_lib",
32 "../core_services_initialization.cc",
33 "mandoline_activity.cc",
34 "mandoline_context_init.cc",
37 # On android, the executable is also the native library used by the apk.
38 # It means dynamic symbols must be preserved and exported.
39 ldflags = [ "-Wl,--export-dynamic" ]
42 copy("copy_mandoline_runner") {
47 "$root_out_dir/mandoline_runner",
50 "$root_shlib_dir/${shlib_prefix}mandoline_runner$shlib_extension",
54 copy_ex("copy_mandoline_assets") {
56 dest = mandoline_assets_dir
58 "//components/devtools_service",
59 "//components/html_viewer",
60 "//components/resource_provider",
61 "//mandoline/services/core_services",
62 "//mojo/runner:bootstrap",
63 "//mojo/runner:bootstrap_java",
64 "//mojo/services/network",
67 "$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar",
68 "$root_shlib_dir/${shlib_prefix}bootstrap$shlib_extension",
71 # Directories can't be specified as sources so pass manually to the script.
73 "--files=" + rebase_path("$root_out_dir/core_services", root_build_dir),
74 "--files=" + rebase_path("$root_out_dir/network_service", root_build_dir),
75 "--files=" + rebase_path("$root_out_dir/resource_provider", root_build_dir),
76 "--files=" + rebase_path("$root_out_dir/devtools_service", root_build_dir),
77 "--files=" + rebase_path("$root_out_dir/html_viewer", root_build_dir),
81 deps += [ "//mandoline/ui" ]
84 "--files=" + rebase_path("$root_out_dir/omnibox", root_build_dir),
85 "--files=" + rebase_path("$root_out_dir/phone_ui", root_build_dir),
90 generate_mojo_shell_assets_list("build_mandoline_assets") {
92 ":copy_mandoline_assets",
94 dir = mandoline_assets_dir
97 android_library("java") {
98 java_files = [ "apk/src/org/chromium/mandoline/MandolineActivity.java" ]
101 "//mojo/runner:java",
106 generate_jni("jni_headers") {
108 "apk/src/org/chromium/mandoline/MandolineActivity.java",
110 jni_package = "mandoline"
113 android_resources("mandoline_apk_resources") {
114 custom_package = "org.chromium.mandoline"
115 resource_dirs = [ "apk/res" ]
118 android_apk("mandoline_apk") {
119 apk_name = "Mandoline"
121 android_manifest = "apk/AndroidManifest.xml"
123 native_libs = [ "${shlib_prefix}mandoline_runner$shlib_extension" ]
125 asset_location = mandoline_assets_dir
128 ":build_mandoline_assets",
129 ":copy_mandoline_runner",
131 ":mandoline_apk_resources",
132 "//mojo/runner:java",
133 "//mojo/runner:resources",
135 "//ui/platform_window/android:platform_window_java",
136 google_play_services_resources,