blob: bfc35d74af697d4b5765d1f1d5e96adb4c3b1afa [file] [log] [blame]
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
assert(is_android)
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//mojo/generate_mojo_shell_assets_list.gni")
mandoline_assets_dir = "$root_build_dir/mandoline_assets"
group("android") {
deps = [
":mandoline_apk",
]
}
executable("mandoline_runner") {
deps = [
":jni_headers",
"//mandoline/ui/browser/public/interfaces",
"//mojo/common",
"//mojo/environment:chromium",
"//mojo/runner:mojo_runner_lib",
]
sources = [
"../core_services_initialization.cc",
"mandoline_activity.cc",
"mandoline_context_init.cc",
]
# On android, the executable is also the native library used by the apk.
# It means dynamic symbols must be preserved and exported.
ldflags = [ "-Wl,--export-dynamic" ]
}
copy("copy_mandoline_runner") {
deps = [
":mandoline_runner",
]
sources = [
"$root_out_dir/exe.stripped/mandoline_runner",
]
outputs = [
"$root_out_dir/lib.stripped/libmandoline_runner$android_product_extension",
]
}
copy_ex("copy_mandoline_assets") {
clear_dir = true
dest = mandoline_assets_dir
deps = [
"//components/devtools_service",
"//components/html_viewer",
"//components/resource_provider",
"//mandoline/services/core_services",
"//mojo/runner:bootstrap",
"//mojo/runner:bootstrap_java",
"//mojo/services/network",
]
sources = [
"$root_out_dir/lib.stripped/libbootstrap$android_product_extension",
"$root_out_dir/obj/mojo/runner/bootstrap_java.dex.jar",
]
# Directories can't be specified as sources so pass manually to the script.
args = [
"--files=" + rebase_path("$root_out_dir/core_services", root_build_dir),
"--files=" + rebase_path("$root_out_dir/network_service", root_build_dir),
"--files=" + rebase_path("$root_out_dir/resource_provider", root_build_dir),
"--files=" + rebase_path("$root_out_dir/devtools_service", root_build_dir),
"--files=" + rebase_path("$root_out_dir/html_viewer", root_build_dir),
]
if (use_aura) {
deps += [ "//mandoline/ui" ]
args += [
"--files=" + rebase_path("$root_out_dir/browser", root_build_dir),
"--files=" + rebase_path("$root_out_dir/omnibox", root_build_dir),
]
}
}
generate_mojo_shell_assets_list("build_mandoline_assets") {
deps = [
":copy_mandoline_assets",
]
dir = mandoline_assets_dir
}
android_library("java") {
java_files = [ "apk/src/org/chromium/mandoline/MandolineActivity.java" ]
deps = [
"//mojo/runner:java",
"//base:base_java",
]
}
generate_jni("jni_headers") {
sources = [
"apk/src/org/chromium/mandoline/MandolineActivity.java",
]
jni_package = "mandoline"
}
android_resources("mandoline_apk_resources") {
custom_package = "org.chromium.mandoline"
resource_dirs = [ "apk/res" ]
}
android_apk("mandoline_apk") {
apk_name = "Mandoline"
android_manifest = "apk/AndroidManifest.xml"
native_libs = [ "libmandoline_runner$android_product_extension" ]
asset_location = mandoline_assets_dir
deps = [
":build_mandoline_assets",
":copy_mandoline_runner",
":java",
":mandoline_apk_resources",
"//mojo/runner:java",
"//mojo/runner:resources",
"//base:base_java",
"//third_party/android_tools:google_play_services_default_resources",
"//ui/platform_window/android:platform_window_java",
]
}