naiveproxy/content/shell/android/BUILD.gn
2018-12-09 21:59:24 -05:00

354 lines
11 KiB
Plaintext

# Copyright 2014 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.
import("//base/android/jni_generator/jni_exception_list.gni")
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//third_party/icu/config.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
content_shell_manifest =
"$target_gen_dir/content_shell_manifest/AndroidManifest.xml"
generate_jni("content_shell_jni_headers") {
jni_package = "content/shell"
sources = [
"java/src/org/chromium/content_shell/Shell.java",
"java/src/org/chromium/content_shell/ShellManager.java",
]
}
generate_jni_registration("content_shell_jni_registration") {
testonly = true
target = ":content_shell_apk"
output = "$root_gen_dir/content/shell/android/${target_name}.h"
exception_files = jni_exception_files
}
shared_library("libcontent_shell_content_view") {
testonly = true
deps = [
":content_shell_jni_headers",
":content_shell_jni_registration",
"//components/crash/content/browser",
"//content/shell:content_shell_lib",
"//content/shell:pak",
"//media",
"//skia",
]
# Explicit dependency required for JNI registration to be able to
# find the native side functions.
if (is_component_build) {
deps += [
"//device/gamepad",
"//media/midi",
]
}
sources = [
"shell_library_loader.cc",
]
}
shared_library("libcontent_native_test") {
testonly = true
deps = [
":content_test_jni_registration",
"//base",
"//content/public/test/android:content_native_test_support",
"//content/shell:content_shell_lib",
]
sources = [
"shell_test_library_loader.cc",
]
}
android_resources("content_shell_java_resources") {
testonly = true
resource_dirs = [ "java/res" ]
custom_package = "org.chromium.content_shell"
}
android_library("content_shell_java") {
testonly = true
deps = [
":content_shell_java_resources",
":content_shell_manifest",
"//base:base_java",
"//components/embedder_support/android:content_view_java",
"//components/embedder_support/android:view_java",
"//components/viz/service:service_java",
"//content/public/android:content_java",
"//media/base/android:media_java",
"//media/capture/video/android:capture_java",
"//mojo/public/java:system_java",
"//net/android:net_java",
"//ui/android:ui_java",
]
java_files = [
"java/src/org/chromium/content_shell/Shell.java",
"java/src/org/chromium/content_shell/ShellManager.java",
"java/src/org/chromium/content_shell/ShellViewAndroidDelegate.java",
]
android_manifest_for_lint = content_shell_manifest
}
jinja_template("content_shell_manifest") {
testonly = true
input = "shell_apk/AndroidManifest.xml.jinja2"
output = content_shell_manifest
}
android_resources("content_shell_apk_resources") {
testonly = true
resource_dirs = [ "shell_apk/res" ]
deps = [
":content_shell_java_resources",
]
android_manifest = content_shell_manifest
android_manifest_dep = ":content_shell_manifest"
}
android_library("content_shell_apk_java") {
testonly = true
srcjar_deps = [ ":content_javatests_aidl" ]
deps = [
":content_shell_apk_resources",
":content_shell_java",
":content_shell_manifest",
"//base:base_java",
"//content/public/android:content_java",
"//media/capture/video/android:capture_java",
"//net/android:net_java",
"//third_party/jsr-305:jsr_305_javalib",
"//ui/android:ui_java",
]
android_manifest_for_lint = content_shell_manifest
java_files = [
"shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestHelperService.java",
"shell_apk/src/org/chromium/content_shell_apk/ChildProcessLauncherTestUtils.java",
"shell_apk/src/org/chromium/content_shell_apk/ContentShellActivity.java",
"shell_apk/src/org/chromium/content_shell_apk/ContentShellApplication.java",
"shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService.java",
"shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService0.java",
"shell_apk/src/org/chromium/content_shell_apk/TestChildProcessService1.java",
]
}
android_aidl("content_javatests_aidl") {
import_include = [ "shell_apk/src" ]
sources = [
"shell_apk/src/org/chromium/content_shell_apk/IChildProcessTest.aidl",
]
}
android_assets("content_shell_assets") {
sources = [
"$root_out_dir/content_shell.pak",
]
disable_compression = true
deps = [
"//content/shell:pak",
"//third_party/icu:icu_assets",
]
if (use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
} else {
deps += [ "//v8:v8_external_startup_data_assets" ]
}
}
android_apk("content_shell_apk") {
testonly = true
enable_multidex = true
deps = [
":content_shell_apk_java",
":content_shell_assets",
":content_shell_java",
"//base:base_java",
"//base:base_java_test_support",
"//components/crash/android:java",
"//content/public/android:content_java",
"//content/public/test/android:layouttest_java_support",
"//media/capture/video/android:capture_java",
"//net/android:net_java",
"//services/shape_detection:shape_detection_java",
"//third_party/mesa_headers",
"//ui/android:ui_java",
]
apk_name = "ContentShell"
android_manifest = content_shell_manifest
android_manifest_dep = ":content_shell_manifest"
shared_libraries = [ ":libcontent_shell_content_view" ]
command_line_flags_file = "content-shell-command-line"
}
android_library("content_shell_test_java") {
testonly = true
deps = [
":content_shell_apk_java",
":content_shell_java",
"//base:base_java",
"//base:base_java_test_support",
"//content/public/android:content_java",
"//content/public/test/android:content_java_test_support",
"//content/shell/android:content_shell_java",
"//mojo/public/java/system:test_support_java",
"//third_party/android_support_test_runner:rules_java",
"//third_party/android_support_test_runner:runner_java",
"//third_party/junit:junit",
"//ui/android:ui_java",
]
java_files = [
"javatests/src/org/chromium/content_shell_apk/ContentShellPreconditionsTest.java",
"javatests/src/org/chromium/content_shell_apk/ContentShellShellManagementTest.java",
"javatests/src/org/chromium/content_shell_apk/ContentShellActivityTestRule.java",
"javatests/src/org/chromium/content_shell_apk/ContentShellUrlTest.java",
]
}
generate_jni_registration("content_test_jni_registration") {
testonly = true
target = ":content_shell_test_apk__apk"
output = "$root_gen_dir/content/shell/android/${target_name}.h"
exception_files = jni_exception_files
}
instrumentation_test_apk("content_shell_test_apk") {
deps = [
"//base:base_java_test_support",
"//base:base_javatests",
"//content/public/android:content_javatests",
"//net/android:net_javatests",
"//third_party/android_support_test_runner:runner_java",
]
apk_under_test = ":content_shell_apk"
apk_name = "ContentShellTest"
shared_libraries = [ ":libcontent_native_test" ]
android_manifest = "javatests/AndroidManifest.xml"
}
if (current_cpu != "x64") {
chromium_linker_test_manifest =
"$target_gen_dir/linker_test_apk/AndroidManifest.xml"
jinja_template("chromium_linker_test_manifest") {
testonly = true
input = "linker_test_apk/AndroidManifest.xml.jinja2"
output = chromium_linker_test_manifest
}
android_resources("linker_resources") {
testonly = true
resource_dirs = [ "linker_test_apk/res" ]
android_manifest = chromium_linker_test_manifest
android_manifest_dep = ":chromium_linker_test_manifest"
}
_linker_test_apk_target_name = "chromium_linker_test_apk__apk"
_linker_test_apk_test_runner_target_name =
"chromium_linker_test_apk__test_runner_script"
android_apk(_linker_test_apk_target_name) {
testonly = true
enable_multidex = true
deps = [
":content_shell_assets",
":content_shell_java",
":linker_resources",
"//base:base_java",
"//content/public/android:content_java",
"//ui/android:ui_java",
]
android_manifest = chromium_linker_test_manifest
android_manifest_dep = ":chromium_linker_test_manifest"
apk_name = "ChromiumLinkerTest"
java_files = [
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestActivity.java",
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/ChromiumLinkerTestApplication.java",
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
]
shared_libraries = [ ":linker_test" ]
use_chromium_linker = true
enable_chromium_linker_tests = true
}
test_runner_script(_linker_test_apk_test_runner_target_name) {
test_name = "chromium_linker_test_apk"
test_type = "linker"
apk_target = ":$_linker_test_apk_target_name"
ignore_all_data_deps = true
}
group("chromium_linker_test_apk") {
testonly = true
deps = [
":$_linker_test_apk_target_name",
":$_linker_test_apk_test_runner_target_name",
]
}
shared_library("linker_test") {
testonly = true
sources = [
"linker_test_apk/chromium_linker_test_android.cc",
"linker_test_apk/chromium_linker_test_linker_tests.cc",
]
deps = [
":linker_test_jni_headers",
":linker_test_jni_registration",
"//content/shell:content_shell_lib",
# Required to include "content/public/browser/android/compositor.h"
# in chromium_linker_test_android.cc :-(
"//skia",
"//third_party/re2",
]
# Explicit dependency required for JNI registration to be able to
# find the native side functions.
if (is_component_build) {
deps += [
"//device/gamepad",
"//media/midi",
]
}
}
generate_jni("linker_test_jni_headers") {
testonly = true
jni_package = "content/shell"
sources = [
"linker_test_apk/src/org/chromium/chromium_linker_test_apk/LinkerTests.java",
]
}
generate_jni_registration("linker_test_jni_registration") {
testonly = true
target = ":chromium_linker_test_apk__apk"
output =
"$root_gen_dir/content/shell/android/linker_test_apk/${target_name}.h"
exception_files = jni_exception_files
}
}
android_library("content_shell_browsertests_java") {
testonly = true
deps = [
":content_shell_java",
"//base:base_java",
"//content/public/android:content_java",
"//testing/android/native_test:native_test_java",
"//ui/android:ui_java",
]
java_files = [ "browsertests/src/org/chromium/content_shell/browsertests/ContentShellBrowserTestActivity.java" ]
}