0

Make content_shell_apk build completely

This fixes configuration of various targets (mostly adding some missing
files for is_android builds).

Adds a target setting up the content_shell_apk assets directory.

Uncomments the previously non-working dependencies from
libcontent_shell_content_view.

Adds forwarding of testonly in all of the android templates.

TBR=mark@

BUG=359249

Review URL: https://codereview.chromium.org/569923003

Cr-Commit-Position: refs/heads/master@{#296319}
This commit is contained in:
cjhopman
2014-09-23 17:52:56 -07:00
committed by Commit bot
parent f3e00b33be
commit 2fd48fd14b
12 changed files with 138 additions and 77 deletions
base
breakpad
build
config
secondary
third_party
content
browser
public
android
renderer
shell
ui/android

@ -895,13 +895,18 @@ component("base") {
} else {
# Non-Linux.
sources -= [
"linux_util.cc",
"linux_util.h",
"nix/mime_util_xdg.cc",
"nix/mime_util_xdg.h",
"nix/xdg_util.cc",
"nix/xdg_util.h",
]
if (!is_android) {
sources -= [
"linux_util.cc",
"linux_util.h",
]
}
}
if (!use_glib) {

@ -394,6 +394,8 @@ if (is_linux || is_android) {
}
static_library("client") {
# Want all these sources for both Linux and Android.
set_sources_assignment_filter([])
sources = [
"src/client/linux/crash_generation/crash_generation_client.cc",
"src/client/linux/crash_generation/crash_generation_client.h",

@ -15,6 +15,8 @@ android_sdk_jar = "$android_sdk/android.jar"
rebased_android_sdk_jar = rebase_path(android_sdk_jar, root_build_dir)
template("android_lint") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
jar_path = invoker.jar_path
android_manifest = invoker.android_manifest
java_files = invoker.java_files
@ -63,6 +65,8 @@ template("android_lint") {
# See build/android/gyp/write_build_config.py and
# build/android/gyp/util/build_utils.py:ExpandFileArgs
template("write_build_config") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.type))
assert(defined(invoker.build_config))
@ -80,9 +84,6 @@ template("write_build_config") {
if (defined(invoker.deps)) {
deps += invoker.deps
}
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
outputs = [
depfile,
@ -154,6 +155,8 @@ template("write_build_config") {
# Creates a zip archive of the inputs.
# If base_dir is provided, the archive paths will be relative to it.
template("zip") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.inputs))
assert(defined(invoker.output))
@ -181,6 +184,8 @@ template("zip") {
}
template("dex") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.sources))
assert(defined(invoker.output))
action(target_name) {
@ -221,6 +226,8 @@ template("dex") {
# Packages resources, assets, dex, and native libraries into an apk. Signs and
# zipaligns the apk.
template("create_apk") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
_android_manifest = invoker.android_manifest
_base_path = invoker.base_path
_final_apk_path = invoker.apk_path
@ -357,6 +364,8 @@ template("create_apk") {
}
template("java_prebuilt") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
_input_jar_path = invoker.input_jar_path
_output_jar_path = invoker.output_jar_path
_jar_toc_path = _output_jar_path + ".TOC"
@ -438,6 +447,8 @@ template("java_prebuilt") {
# jar_path: Use this to explicitly set the output jar path. Defaults to
# "${target_gen_dir}/${target_name}.jar.
template("java_library") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.java_files))
assert(defined(invoker.build_config))
assert(defined(invoker.jar_path))
@ -529,6 +540,8 @@ template("java_library") {
# Runs Android lint against the compiled java files.
# Dexes the output jar for inclusion in an APK.
template("android_java_library") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir))
assert(defined(invoker.build_config))
assert(defined(invoker.jar_path))
@ -611,6 +624,8 @@ template("android_java_library") {
# Runs process_resources.py
template("process_resources") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
zip_path = invoker.zip_path
srcjar_path = invoker.srcjar_path
build_config = invoker.build_config
@ -689,12 +704,18 @@ template("process_resources") {
}
template("copy_ex") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
action(target_name) {
script = "//build/android/gyp/copy_ex.py"
depfile = "$target_gen_dir/$target_name.d"
outputs = [
depfile,
]
sources = []
if (defined(invoker.sources)) {
sources += invoker.sources
}
inputs = []
if (defined(invoker.inputs)) {
@ -708,6 +729,9 @@ template("copy_ex") {
if (defined(invoker.args)) {
args += invoker.args
}
rebased_sources = rebase_path(sources, root_build_dir)
args += [ "--files=$rebased_sources" ]
if (defined(invoker.clear_dir) && invoker.clear_dir) {
args += ["--clear"]
}

@ -29,6 +29,8 @@ assert(is_android)
# jni_package = "foo"
# }
template("generate_jni") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.sources))
assert(defined(invoker.jni_package))
jni_package = invoker.jni_package
@ -105,6 +107,8 @@ template("generate_jni") {
# jni_package = "foo"
# }
template("generate_jar_jni") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.classes))
assert(defined(invoker.jni_package))
@ -204,6 +208,8 @@ template("generate_jar_jni") {
# include_path = "android/java/templates"
# }
template("java_cpp_template") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.sources))
package_name = invoker.package_name + ""
@ -289,6 +295,8 @@ template("java_cpp_template") {
# ]
# }
template("java_cpp_enum") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.sources))
assert(defined(invoker.outputs))
@ -356,6 +364,8 @@ template("java_cpp_enum") {
# custom_package = "org.chromium.foo"
# }
template("android_resources") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.resource_dirs))
assert(defined(invoker.android_manifest) || defined(invoker.custom_package))
@ -413,6 +423,8 @@ template("android_resources") {
# grd_file = "foo_strings.grd"
# }
template("java_strings_grd") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
base_path = "$target_gen_dir/$target_name"
resources_zip = base_path + ".resources.zip"
build_config = base_path + ".build_config"
@ -499,6 +511,8 @@ template("java_strings_grd") {
# ]
# }
template("android_library") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.java_files) || defined(invoker.DEPRECATED_java_in_dir))
_base_path = "$target_gen_dir/$target_name"
_build_config = _base_path + ".build_config"
@ -577,6 +591,8 @@ template("android_library") {
# ]
# }
template("android_java_prebuilt") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.jar_path))
_base_path = "${target_gen_dir}/$target_name"
_jar_path = _base_path + ".jar"
@ -669,6 +685,8 @@ template("android_java_prebuilt") {
# ]
# }
template("android_apk") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
assert(defined(invoker.final_apk_path) || defined(invoker.apk_name))
gen_dir = "$target_gen_dir/$target_name"
base_path = "$gen_dir/$target_name"
@ -721,9 +739,6 @@ template("android_apk") {
if (defined(invoker.deps)) {
deps = invoker.deps
}
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
native_libs = _native_libs
}
@ -866,7 +881,8 @@ template("android_apk") {
group(target_name) {
deps = final_deps
if (defined(invoker.datadeps)) {
datadeps = invoker.datadeps
# TODO(cjhopman): Fix this when group datadeps works.
deps += invoker.datadeps
}
}
}
@ -895,6 +911,8 @@ template("android_apk") {
# unittests_dep = ":foo_unittests"
# }
template("unittest_apk") {
testonly = true
assert(defined(invoker.unittests_dep), "Need unittests_dep for $target_name")
test_suite_name = get_label_info(invoker.unittests_dep, "name")
@ -920,7 +938,6 @@ template("unittest_apk") {
datadeps = [
"//tools/android/md5sum",
]
testonly = true
}
}
@ -944,6 +961,8 @@ template("unittest_apk") {
# ]
# }
template("android_aidl") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
srcjar_path = "${target_gen_dir}/${target_name}.srcjar"
aidl_path = "${android_sdk_build_tools}/aidl"
framework_aidl = "$android_sdk/framework.aidl"
@ -1015,6 +1034,8 @@ template("android_aidl") {
# binary = "$root_build_dir/exe.stripped/foo"
# }
template("create_native_executable_dist") {
if (defined(invoker.testonly)) { testonly = invoker.testonly }
dist_dir = invoker.dist_dir
binary = invoker.binary
final_deps = []

@ -2,21 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
declare_args() {
# Tells icu to load an external data file rather than rely on the icudata
# being linked directly into the binary.
#
# This flag is a bit confusing. As of this writing, icu.gyp set the value to
# 0 but common.gypi sets the value to 1 for most platforms (and the 1 takes
# precedence).
#
# TODO(GYP) We'll probably need to enhance this logic to set the value to
# true or false in similar circumstances. Note that in the GYP build, some
# other projects access this variable. If we need to do a similar thing,
# we should probably make an icu config file (//third_party/icu/config.gni)
# with this flag in it rather than making it global.
icu_use_data_file = true
}
import("//third_party/icu/config.gni")
# Meta target that includes both icuuc and icui18n. Most targets want both.
# You can depend on the individually if you need to.

@ -0,0 +1,16 @@
# 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.
declare_args() {
# Tells icu to load an external data file rather than rely on the icudata
# being linked directly into the binary.
#
# This flag is a bit confusing. As of this writing, icu.gyp set the value to
# 0 but common.gypi sets the value to 1 for most platforms (and the 1 takes
# precedence).
#
# TODO(GYP) We'll probably need to enhance this logic to set the value to
# true or false in similar circumstances.
icu_use_data_file = true
}

@ -5,6 +5,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//content/browser/browser.gni")
import("//media/media_options.gni")
source_set("browser") {
# Only the public target should depend on this. All other targets (even
@ -408,4 +409,13 @@ source_set("browser") {
if (is_linux && use_dbus) {
deps += [ "//dbus" ]
}
if (enable_browser_cdms) {
sources += [
"media/cdm/browser_cdm_manager.cc",
"media/cdm/browser_cdm_manager.h",
"media/media_web_contents_observer.cc",
"media/media_web_contents_observer.h",
]
}
}

@ -213,6 +213,7 @@ group("jni") {
}
android_library("content_javatests") {
testonly = true
deps = [
"//base:base_java",
"//base:base_java_test_support",

@ -5,6 +5,7 @@
import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//content/renderer/renderer.gni")
import("//media/media_options.gni")
source_set("renderer") {
# Only the public target should depend on this. All other targets (even
@ -186,4 +187,13 @@ source_set("renderer") {
if (printing_mode == 1) {
deps += [ "//printing" ]
}
if (enable_browser_cdms) {
sources += [
"media/crypto/proxy_media_keys.cc",
"media/crypto/proxy_media_keys.h",
"media/crypto/renderer_cdm_manager.cc",
"media/crypto/renderer_cdm_manager.h",
]
}
}

@ -431,13 +431,9 @@ repack("pak") {
"//ui/strings",
]
if (is_android) {
output = "$root_out_dir/content_shell/assets/content_shell.pak"
} else {
sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
deps += [ "//content/browser/devtools:resources" ]
output = "$root_out_dir/content_shell.pak"
}
sources += [ "$root_gen_dir/webkit/devtools_resources.pak" ]
deps += [ "//content/browser/devtools:resources" ]
output = "$root_out_dir/content_shell.pak"
}
# TODO(GYP): Figure out what this should be on android

@ -4,6 +4,7 @@
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
import("//third_party/icu/config.gni")
generate_jni("content_shell_jni_headers") {
jni_package = "content/shell"
@ -16,17 +17,18 @@ generate_jni("content_shell_jni_headers") {
}
shared_library("libcontent_shell_content_view") {
# TODO(GYP,cjhopman): enable these when content_shell builds
testonly = true
deps = [
":content_shell_jni_headers",
#"//content/shell:content_shell",
#"//content/shell:content_shell_pak",
"//content/shell:content_shell_lib",
"//content/shell:pak",
"//components/crash/browser",
"//skia",
"//media/base/android",
]
sources = [
#"shell_library_loader.cc",
#"shell_library_loader.h",
"shell_library_loader.cc",
"shell_library_loader.h",
]
if (is_android_webview_build) {
ldflags = [
@ -36,11 +38,13 @@ shared_library("libcontent_shell_content_view") {
}
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 = [
"//base:base_java",
"//content/public/android:content_java",
@ -53,6 +57,7 @@ android_library("content_shell_java") {
}
android_resources("content_shell_apk_resources") {
testonly = true
resource_dirs = [ "shell_apk/res" ]
deps = [
":content_shell_java_resources"
@ -61,6 +66,7 @@ android_resources("content_shell_apk_resources") {
}
android_library("content_shell_apk_java") {
testonly = true
deps = [
":content_shell_apk_resources",
":content_shell_java",
@ -73,7 +79,23 @@ android_library("content_shell_apk_java") {
DEPRECATED_java_in_dir = "shell_apk/src"
}
content_shell_assets_dir = "$root_build_dir/content_shell/assets"
copy_ex("copy_content_shell_assets") {
clear_dir = true
dest = content_shell_assets_dir
sources = [
"$root_out_dir/content_shell.pak"
]
if (icu_use_data_file) {
sources += [
"$root_build_dir/icudtl.dat"
]
}
}
android_apk("content_shell_apk") {
testonly = true
datadeps = [
# "//tools/android/forwarder",
]
@ -82,9 +104,9 @@ android_apk("content_shell_apk") {
":content_shell_java",
":content_shell_apk_java",
":libcontent_shell_content_view",
":copy_content_shell_assets",
"//base:base_java",
"//content/public/android:content_java",
"//content/public/android:content_java_resources",
"//media/base/android:media_java",
"//net/android:net_java",
#"//third_party/mesa:osmesa_in_lib_dir",
@ -95,22 +117,18 @@ android_apk("content_shell_apk") {
native_libs = [
"$root_build_dir/lib.stripped/libcontent_shell_content_view.so"
]
asset_location = "$root_build_dir/content_shell/assets"
asset_location = content_shell_assets_dir
# TODO(GYP)
#'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'],
#'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
if (false && icu_use_data_file_flag) {
# TODO(GYP)
}
if (is_android_webview_build) {
# TODO(GYP)
}
}
android_library("content_shell_test_java") {
testonly = true
deps = [
":content_shell_java",
":content_shell_apk_java",
@ -124,11 +142,15 @@ android_library("content_shell_test_java") {
}
android_apk("content_shell_test_apk") {
testonly = true
deps = [
"//content/public/android:content_javatests",
"//base:base_javatests",
"//net/android:net_javatests",
]
datadeps = [
":content_shell_apk",
]
apk_name = "ContentShellTest"
android_manifest = "javatests/AndroidManifest.xml"
}

@ -84,39 +84,7 @@ android_resources("ui_java_resources") {
}
android_library("ui_java") {
java_files = [
"java/src/org/chromium/ui/ColorPickerAdvanced.java",
"java/src/org/chromium/ui/ColorPickerAdvancedComponent.java",
"java/src/org/chromium/ui/ColorPickerDialog.java",
"java/src/org/chromium/ui/ColorPickerMoreButton.java",
"java/src/org/chromium/ui/ColorPickerSimple.java",
"java/src/org/chromium/ui/ColorSuggestion.java",
"java/src/org/chromium/ui/ColorSuggestionListAdapter.java",
"java/src/org/chromium/ui/DropdownAdapter.java",
"java/src/org/chromium/ui/DropdownDividerDrawable.java",
"java/src/org/chromium/ui/DropdownItem.java",
"java/src/org/chromium/ui/DropdownPopupWindow.java",
"java/src/org/chromium/ui/OnColorChangedListener.java",
"java/src/org/chromium/ui/UiUtils.java",
"java/src/org/chromium/ui/VSyncMonitor.java",
"java/src/org/chromium/ui/autofill/AutofillPopup.java",
"java/src/org/chromium/ui/autofill/AutofillSuggestion.java",
"java/src/org/chromium/ui/base/ActivityWindowAndroid.java",
"java/src/org/chromium/ui/base/Clipboard.java",
"java/src/org/chromium/ui/base/DeviceFormFactor.java",
"java/src/org/chromium/ui/base/LocalizationUtils.java",
"java/src/org/chromium/ui/base/ResourceBundle.java",
"java/src/org/chromium/ui/base/SelectFileDialog.java",
"java/src/org/chromium/ui/base/TouchDevice.java",
"java/src/org/chromium/ui/base/ViewAndroid.java",
"java/src/org/chromium/ui/base/ViewAndroidDelegate.java",
"java/src/org/chromium/ui/base/WindowAndroid.java",
"java/src/org/chromium/ui/gfx/BitmapHelper.java",
"java/src/org/chromium/ui/gfx/DeviceDisplayInfo.java",
"java/src/org/chromium/ui/gfx/ViewConfigurationHelper.java",
"java/src/org/chromium/ui/gl/SurfaceTextureListener.java",
"java/src/org/chromium/ui/gl/SurfaceTexturePlatformWrapper.java",
]
DEPRECATED_java_in_dir = "java/src"
deps = [
":ui_java_resources",
"//base:base_java",