This mostly just adds the chrome_shell_apk build definition and those of
a whole bunch of targets.

Adds a simple check that when DEPRECATED_java_in_dir is used, it
actually includes the "src" at the end (GYP just assumes that you really
meant that java files are in <(java_in_dir)/src).

Makes the call to process_resources only generate R.java for extra
packages when being run as part of the apk step (otherwise, for
example, both chrome resources and content resources would contain
an R.java for net resources and compilation would fail).

Depends on https://codereview.chromium.org/581273004/

Adds the following targets -- and enables ~300 more (550 counting
template-generated inner targets):

//chrome:chrome_android_core
//chrome/android:chrome_strings_grd
//chrome/android:chrome_java
//chrome/android:activity_type_ids_javagen
//chrome/android:app_banner_metrics_ids_javagen
//chrome/android:resource_id_javagen
//chrome/android:profile_account_management_metrics_javagen
//chrome/android:profile_sync_service_model_type_selection_javagen
//chrome/android:toolbar_model_security_levels_javagen
//chrome/android:tab_load_status_javagen
//chrome/android:chrome_shell_base
//chrome/android:chrome_shell
//chrome/android:chrome_sync_shell
//chrome/android:chrome_shell_resources
//chrome/android:chrome_shell_java
//chrome/android:chrome_shell_assets
//chrome/android:chrome_shell_apk
//chrome/android:chrome_sync_shell_apk
//components/bookmarks:bookmarks_java
//components/bookmarks:bookmarks_jni_headers
//components/bookmarks:bookmark_type_javagen
//components/dom_distiller/android:dom_distiller_core_java
//components/dom_distiller/android:dom_distiller_core_font_family_javagen
//components/dom_distiller/android:dom_distiller_core_theme_javagen
//components/enhanced_bookmarks:jni_headers
//components/enhanced_bookmarks/android:enhanced_bookmarks_java
//components/gcm_driver:gcm_driver_java
//components/gcm_driver:jni_headers
//components/navigation_interception/android:navigation_interception_java
//components/variations:variations_java
//components/web_contents_delegate_android:web_contents_delegate_android
//components/web_contents_delegate_android:web_contents_delegate_android_java
//components/web_contents_delegate_android:web_contents_delegate_android_jni_headers
//printing:printing_java
//sync:fake_server_jni
//sync:sync_java_test_support
//sync:test_support_sync_fake_server_android
//sync:sync_unit_tests_apk
//sync/android:sync_java
//sync/android:sync_javatests

BUG=359249
TBR=ben

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

Cr-Original-Commit-Position: refs/heads/master@{#299381}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 11a68cbf1df1110ebac0b649edf2aef22682387e
This commit is contained in:
cjhopman 2014-10-13 15:47:54 -07:00 коммит произвёл Commit bot
Родитель 3bd6c7c913
Коммит 37e0be512f
4 изменённых файлов: 43 добавлений и 16 удалений

Просмотреть файл

@ -171,6 +171,9 @@ def main(argv):
config['resources'] = {}
config['resources']['dependency_zips'] = [
c['resources_zip'] for c in all_resources_deps]
config['resources']['extra_package_names'] = []
if options.type == 'android_apk':
config['resources']['extra_package_names'] = [
c['package_name'] for c in all_resources_deps if 'package_name' in c]

Просмотреть файл

@ -63,6 +63,7 @@ if (is_android) {
# Path to the Android NDK and SDK.
android_ndk_root = "//third_party/android_tools/ndk"
android_ndk_include_dir = "$android_ndk_root/usr/include"
android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}"

Просмотреть файл

@ -85,11 +85,6 @@ template("write_build_config") {
deps += invoker.deps
}
outputs = [
depfile,
build_config
]
possible_deps_configs = []
foreach(d, deps) {
dep_gen_dir = get_label_info(d, "target_gen_dir")
@ -98,6 +93,11 @@ template("write_build_config") {
}
rebase_possible_deps_configs = rebase_path(possible_deps_configs)
outputs = [
depfile,
build_config
]
args = [
"--type", type,
"--depfile", rebase_path(depfile, root_build_dir),
@ -565,6 +565,14 @@ template("android_java_library") {
if (defined(invoker.java_files)) {
_java_files = invoker.java_files
} else if (defined(invoker.DEPRECATED_java_in_dir)) {
_src_dir = invoker.DEPRECATED_java_in_dir + "/src"
_src_dir_exists = exec_script("//build/dir_exists.py",
[ rebase_path(_src_dir, root_build_dir) ],
"string")
assert(_src_dir_exists == "False",
"In GN, java_in_dir should be the fully specified java directory " +
"(i.e. including the trailing \"/src\")")
_java_files_build_rel = exec_script(
"//build/android/gyp/find.py",
[
@ -718,10 +726,9 @@ template("copy_ex") {
action(target_name) {
script = "//build/android/gyp/copy_ex.py"
depfile = "$target_gen_dir/$target_name.d"
outputs = [
depfile,
]
if (defined(invoker.deps)) { deps = invoker.deps }
sources = []
if (defined(invoker.sources)) {
sources += invoker.sources
@ -732,18 +739,24 @@ template("copy_ex") {
inputs += invoker.inputs
}
depfile = "$target_gen_dir/$target_name.d"
outputs = [
depfile,
]
args = [
"--depfile", rebase_path(depfile, root_build_dir),
"--dest", rebase_path(invoker.dest, root_build_dir),
]
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"]
}
if (defined(invoker.args)) {
args += invoker.args
}
}
}

Просмотреть файл

@ -34,8 +34,9 @@ template("generate_jni") {
assert(defined(invoker.sources))
assert(defined(invoker.jni_package))
jni_package = invoker.jni_package
base_output_dir = "${root_gen_dir}/${target_name}/${jni_package}"
jni_output_dir = "${base_output_dir}/jni"
base_output_dir = "${target_gen_dir}/${target_name}"
package_output_dir = "${base_output_dir}/${jni_package}"
jni_output_dir = "${package_output_dir}/jni"
jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h"
@ -66,7 +67,13 @@ template("generate_jni") {
}
config("jni_includes_${target_name}") {
include_dirs = [ base_output_dir ]
# TODO(cjhopman): #includes should probably all be relative to
# base_output_dir. Remove that from this config once the includes are
# updated.
include_dirs = [
base_output_dir,
package_output_dir,
]
}
group(target_name) {
@ -79,6 +86,8 @@ template("generate_jni") {
if (defined(invoker.public_deps)) {
public_deps = invoker.public_deps
}
if (defined(invoker.visibility)) { visibility = invoker.visibility }
}
}
@ -982,8 +991,9 @@ template("unittest_apk") {
android_manifest = "//testing/android/java/AndroidManifest.xml"
unittests_outputs = [ unittests_binary ]
native_libs = [unittests_outputs[0]]
deps = [ "//base:base_java" ]
if (defined(invoker.deps)) {
deps = invoker.deps
deps += invoker.deps
}
datadeps = [
"//tools/android/md5sum",