Skip to content

Commit

Permalink
GN: Enable blink and (nearly) all of content in android build
Browse files Browse the repository at this point in the history
This enables all blink targets and nearly all content targets in the
android build. This produces a content shell APK, but not a fully
operational one yet. This also flips on a bunch of other targets pulled
in by deps.

R=brettw@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#294247}
  • Loading branch information
jamesr committed Sep 10, 2014
1 parent a1cfce8 commit 060f2e3
Show file tree
Hide file tree
Showing 15 changed files with 109 additions and 62 deletions.
16 changes: 5 additions & 11 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ group("root") {
"//ui/views",
"//ui/views/controls/webview",
"//ui/web_dialogs",
"//ui/wm",
"//url",
"//v8:v8",
]
Expand All @@ -145,6 +144,10 @@ group("root") {
deps += [ "//tools/xdisplaycheck" ]
}

if (use_aura) {
deps += [ "//ui/wm" ]
}

if (is_win) {
deps += [
"//ui/metro_viewer",
Expand Down Expand Up @@ -178,7 +181,6 @@ group("root") {

deps -= [
"//apps", # Needs testing.
"//cc/blink", # Blocked on blink
"//chrome/browser", # Blocked on content.
"//chrome/browser/devtools", # Blocked on content.
"//chrome/browser/ui", # Blocked on content.
Expand All @@ -188,23 +190,16 @@ group("root") {
"//chrome/renderer", # Blocked on content.
"//chrome/service", # Blocked on content.
"//chrome/utility", # Blocked on content.
"//content",
"//content/shell:content_shell", # Blocked on content.
"//content/test:test_support", # Blocked on content.
"//content/shell:content_shell",
"//extensions/browser",
"//extensions/common",
"//extensions/common/api",
"//extensions/renderer",
"//media/blink", # Blocked on blink
"//pdf", # Not compiled on Android in GYP yet, either.
"//ppapi:ppapi_c",
"//sandbox",
"//third_party/libusb",
"//ui/keyboard", # Blocked on content.

# Blocked on neon stuff in vp8
"//third_party/WebKit/public:all_blink",

# Seems to not be compiled on Android. Otherwise it will need a config.h.
"//third_party/libxslt",

Expand All @@ -229,7 +224,6 @@ group("root") {
"//third_party/ffmpeg",
"//ui/app_list",
"//ui/web_dialogs",
"//ui/wm",
]
}

Expand Down
8 changes: 5 additions & 3 deletions breakpad/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ if (is_mac) {
}
}

if (is_linux || is_android) {
if (is_linux) {
executable("symupload") {
sources = [
"src/tools/linux/symupload/sym_upload.cc",
Expand All @@ -328,7 +328,7 @@ if (is_linux || is_android) {
}
}

if (is_linux) {
if (is_linux || is_android) {
if (current_toolchain == host_toolchain) {
# dump_syms is a host tool, so only compile it for the host system.
executable("dump_syms") {
Expand Down Expand Up @@ -487,7 +487,9 @@ if (is_linux) {
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
}
}

if (is_linux) {
test("breakpad_unittests") {
sources = [
"linux/breakpad_googletest_includes.h",
Expand Down Expand Up @@ -545,7 +547,7 @@ if (is_linux) {
if (is_android) {
sources += [ "src/common/android/breakpad_getcontext_unittest.cc" ]
libs = [ "log" ]
include_dirs = [ "src/common/android/include" ]
include_dirs += [ "src/common/android/include" ]
}
}

Expand Down
4 changes: 4 additions & 0 deletions build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ config("feature_flags") {
# TODO(brettw) should probably be "=1"
defines += [ "ENABLE_PEPPER_CDMS" ]
}
if (enable_browser_cdms) {
# TODO(brettw) should probably be "=1"
defines += [ "ENABLE_BROWSER_CDMS" ]
}
if (enable_plugins) {
defines += [ "ENABLE_PLUGINS=1" ]
}
Expand Down
5 changes: 5 additions & 0 deletions build/config/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ if (is_android) {
android_default_keystore_path = "//build/android/ant/chromium-debug.keystore"
android_default_keystore_name = "chromiumdebugkey"
android_default_keystore_password = "chromium"

# This is a unique identifier for a given build. It's used for
# identifying various build artifacts corresponding to a particular build of
# chrome (e.g. where to find archived symbols).
android_chrome_build_id = "\"\""
}

if (is_android_webview_build) {
Expand Down
2 changes: 2 additions & 0 deletions build/config/features.gni
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ enable_spellcheck = !is_android

enable_pepper_cdms = enable_plugins && (is_linux || is_mac || is_win)

enable_browser_cdms = is_android

# Enable printing support and UI. This variable is used to configure which
# parts of printing will be built. 0 disables printing completely, 1 enables it
# fully, and 2 enables only the codepath to generate a Metafile (e.g. usually
Expand Down
7 changes: 5 additions & 2 deletions components/crash/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ source_set("app") {
":lib",
]

if (is_android) {
defines += [ "CHROME_BUILD_ID=" + android_chrome_build_id ]
}

if (is_mac) {
deps += [ "//breakpad" ]
} else if (is_win) {
Expand All @@ -58,8 +62,7 @@ source_set("app") {
"//breakpad:breakpad_handler",
#'../breakpad/breakpad.gyp:breakpad_sender', TODO(GYP)
]
} else if (is_posix && !is_ios &&
(!is_android || !is_android_webview_build)) {
} else if (is_posix && !is_ios && (!is_android || !is_android_webview_build)) {
deps += [ "//breakpad:client" ]
}
}
Expand Down
2 changes: 1 addition & 1 deletion content/app/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ if (is_win) {
} else if (is_android) {
content_app_sources -= [ "content_main.cc" ]
content_app_deps += [
"//content:content_jni_headers",
"//content/public/android:jni",
"//skia",
"//third_party/android_tools:cpu_features"
]
Expand Down
7 changes: 4 additions & 3 deletions content/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ source_set("browser") {
"//ui/native_theme",
"//ui/resources",
"//ui/snapshot",
"//ui/wm",
]

if (is_ios) {
Expand Down Expand Up @@ -137,7 +136,7 @@ source_set("browser") {
sources -= [ "renderer_host/web_input_event_aurawin.cc" ]
}

if (!is_win && !is_mac && (!is_linux || !use_udev)) {
if (!is_win && !is_mac && !is_android && (!is_linux || !use_udev)) {
sources += [ "gamepad/gamepad_platform_data_fetcher.cc" ]
}

Expand Down Expand Up @@ -261,6 +260,7 @@ source_set("browser") {
} else {
sources -= [
"power_save_blocker_x11.cc",
"renderer_host/web_input_event_aurax11.cc",
]
}

Expand Down Expand Up @@ -308,7 +308,7 @@ source_set("browser") {
"speech/speech_recognizer_impl.h",
]
deps += [
#"//content:jni_headers", TODO(GYP)
"//content/public/android:jni",
"//media",
]
libs += [ "jnigraphics" ]
Expand Down Expand Up @@ -342,6 +342,7 @@ source_set("browser") {
deps += [
"//ui/aura",
"//ui/strings",
"//ui/wm",
]
} else { # Not aura.
sources -= [
Expand Down
9 changes: 4 additions & 5 deletions content/common/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,10 @@ source_set("common") {
"gpu/client/gpu_memory_buffer_impl_surface_texture.h",
]

# TODO(GYP) enable when these targets are converted.
#deps += [
# "//content:content_jni_headers",
# "//content:common_aidl",
#]
deps += [
"//content/public/android:jni",
"//content/public/android:common_aidl",
]

libs += [ "android" ]
}
Expand Down
2 changes: 0 additions & 2 deletions content/content_renderer.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,7 @@
'sources!': [
'renderer/accessibility/renderer_accessibility_focus_only.cc',
'renderer/media/audio_decoder.cc',
'renderer/media/filter_helpers.cc',
'renderer/media/crypto/encrypted_media_player_support_impl.cc',
'renderer/media/webmediaplayer_impl.cc',
],
'sources': [
'renderer/external_popup_menu.cc',
Expand Down
21 changes: 19 additions & 2 deletions content/public/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")

content_jni_gypi_values = exec_script("//build/gypi_to_gn.py",
[ rebase_path("../../content_jni.gypi") ],
"scope",
[ "../../content_jni.gypi" ])

android_aidl("common_aidl") {
interface_file = "java/src/org/chromium/content/common/common.aidl"
import_include = "java/src"
Expand Down Expand Up @@ -200,11 +205,23 @@ java_cpp_template("content_gamepad_mapping_java") {
]
}

generate_jar_jni("content_jni_headers") {
generate_jar_jni("jar_jni") {
jni_package = "content"
classes = [
"android/view/MotionEvent.class",
"java/util/HashSet.class",
"android/view/MotionEvent.class",
]
}

generate_jni("content_jni_headers") {
sources = rebase_path(content_jni_gypi_values.sources, "", "../..")
jni_package = "content"
}

group("jni") {
deps = [
":content_jni_headers",
":jar_jni",
]
}

Expand Down
1 change: 1 addition & 0 deletions content/renderer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ source_set("renderer") {
sources -= [
"accessibility/renderer_accessibility_focus_only.cc",
"media/audio_decoder.cc",
"media/crypto/encrypted_media_player_support_impl.cc",
]
sources += [
"external_popup_menu.cc",
Expand Down
15 changes: 12 additions & 3 deletions content/shell/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static_library("content_shell_lib") {
}

if (is_android) {
deps += [ ":content_shell_jni_headers" ]
deps += [ "//content/shell/android:content_shell_jni_headers" ]
#deps -= [ "copy_test_netscape_plugin" ] TODO(GYP)
}

Expand Down Expand Up @@ -292,6 +292,11 @@ static_library("content_shell_lib") {
} else {
sources += [ "browser/shell_aura.cc" ]
}
} else {
sources -= [
"browser/shell_platform_data_aura.cc",
"browser/shell_platform_data_aura.h",
]
}

# The test plugin relies on X11.
Expand Down Expand Up @@ -430,6 +435,9 @@ repack("pak") {
}
}

# TODO(GYP): Figure out what this should be on android
if (!is_android) {

executable("content_shell") {
testonly = true
# TODO(GYP) mac resource bundle stuff for this target.
Expand All @@ -446,7 +454,6 @@ executable("content_shell") {
":content_shell_lib",
":pak",
"//base/allocator",
"//third_party/mesa:osmesa",
]

if (is_win) {
Expand All @@ -461,11 +468,13 @@ executable("content_shell") {
# TODO(GYP) lots of stuff from GYP file here.
}

if (!is_android || !is_android_webview_build) {
if (is_android && !is_android_webview_build) {
# Some tests rely on this tool. It might be nicer if these tests relied on
# image diff rather than having content shell depend on it.
datadeps = [
"//tools/imagediff($host_toolchain)",
]
}
}

}
10 changes: 9 additions & 1 deletion content/test/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,18 @@ if (!is_ios) {
]

if (is_android) {
#deps += [ "test_support_content_jni_headers" ] TODO(GYP)
deps += [ ":jni" ]
}
}

if (is_android) {
import("//build/config/android/rules.gni")

generate_jni("jni") {
sources = [ "../public/test/android/javatests/src/org/chromium/content/browser/test/NestedSystemMessageHandler.java" ]
jni_package = "content/public/test"
}
}
} # !is_ios

# TODO(GYP): Unit test targets
Expand Down
Loading

0 comments on commit 060f2e3

Please sign in to comment.