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") {
22 "//mandoline/ui/browser/public/interfaces",
24 "//mojo/environment:chromium",
25 "//mojo/runner:mojo_runner_lib",
29 "../core_services_initialization.cc",
30 "mandoline_activity.cc",
31 "mandoline_context_init.cc",
34 # On android, the executable is also the native library used by the apk.
35 # It means dynamic symbols must be preserved and exported.
36 ldflags = [ "-Wl,--export-dynamic" ]
39 copy("copy_mandoline_runner") {
44 "$root_out_dir/exe.stripped/mandoline_runner",
47 "$root_out_dir/lib.stripped/libmandoline_runner.so",
51 copy_ex("copy_mandoline_assets") {
53 dest = mandoline_assets_dir
55 "//components/devtools_service",
56 "//components/html_viewer",
57 "//mandoline/services/core_services",
58 "//mojo/runner:bootstrap",
59 "//mojo/runner:bootstrap_java",
62 "$root_out_dir/lib.stripped/libbootstrap.so",
63 "$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar",
66 # Directories can't be specified as sources so pass manually to the script.
68 "--files=" + rebase_path("$root_out_dir/core_services", root_build_dir),
69 "--files=" + rebase_path("$root_out_dir/devtools_service", root_build_dir),
70 "--files=" + rebase_path("$root_out_dir/html_viewer", root_build_dir),
75 "//mandoline/ui/browser",
76 "//mandoline/ui/omnibox",
80 "--files=" + rebase_path("$root_out_dir/browser", root_build_dir),
81 "--files=" + rebase_path("$root_out_dir/omnibox", root_build_dir),
86 generate_mojo_shell_assets_list("build_mandoline_assets") {
88 ":copy_mandoline_assets",
90 dir = mandoline_assets_dir
93 android_library("java") {
94 java_files = [ "apk/src/org/chromium/mandoline/MandolineActivity.java" ]
102 generate_jni("jni_headers") {
104 "apk/src/org/chromium/mandoline/MandolineActivity.java",
106 jni_package = "mandoline"
109 android_resources("mandoline_apk_resources") {
110 custom_package = "org.chromium.mandoline"
111 resource_dirs = [ "apk/res" ]
114 android_apk("mandoline_apk") {
115 apk_name = "Mandoline"
117 android_manifest = "apk/AndroidManifest.xml"
119 native_libs = [ "libmandoline_runner.so" ]
121 asset_location = mandoline_assets_dir
124 ":build_mandoline_assets",
125 ":copy_mandoline_runner",
127 ":mandoline_apk_resources",
128 "//mojo/runner:java",
129 "//mojo/runner:resources",
131 "//third_party/android_tools:google_play_services_default_resources",
132 "//ui/platform_window/android:platform_window_java",