Make chrome_shell_apk build
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:
Родитель
3bd6c7c913
Коммит
37e0be512f
|
@ -171,6 +171,9 @@ def main(argv):
|
||||||
config['resources'] = {}
|
config['resources'] = {}
|
||||||
config['resources']['dependency_zips'] = [
|
config['resources']['dependency_zips'] = [
|
||||||
c['resources_zip'] for c in all_resources_deps]
|
c['resources_zip'] for c in all_resources_deps]
|
||||||
|
config['resources']['extra_package_names'] = []
|
||||||
|
|
||||||
|
if options.type == 'android_apk':
|
||||||
config['resources']['extra_package_names'] = [
|
config['resources']['extra_package_names'] = [
|
||||||
c['package_name'] for c in all_resources_deps if 'package_name' in c]
|
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.
|
# Path to the Android NDK and SDK.
|
||||||
android_ndk_root = "//third_party/android_tools/ndk"
|
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}"
|
android_sdk = "${android_sdk_root}/platforms/android-${android_sdk_version}"
|
||||||
|
|
||||||
|
|
|
@ -85,11 +85,6 @@ template("write_build_config") {
|
||||||
deps += invoker.deps
|
deps += invoker.deps
|
||||||
}
|
}
|
||||||
|
|
||||||
outputs = [
|
|
||||||
depfile,
|
|
||||||
build_config
|
|
||||||
]
|
|
||||||
|
|
||||||
possible_deps_configs = []
|
possible_deps_configs = []
|
||||||
foreach(d, deps) {
|
foreach(d, deps) {
|
||||||
dep_gen_dir = get_label_info(d, "target_gen_dir")
|
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)
|
rebase_possible_deps_configs = rebase_path(possible_deps_configs)
|
||||||
|
|
||||||
|
outputs = [
|
||||||
|
depfile,
|
||||||
|
build_config
|
||||||
|
]
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
"--type", type,
|
"--type", type,
|
||||||
"--depfile", rebase_path(depfile, root_build_dir),
|
"--depfile", rebase_path(depfile, root_build_dir),
|
||||||
|
@ -565,6 +565,14 @@ template("android_java_library") {
|
||||||
if (defined(invoker.java_files)) {
|
if (defined(invoker.java_files)) {
|
||||||
_java_files = invoker.java_files
|
_java_files = invoker.java_files
|
||||||
} else if (defined(invoker.DEPRECATED_java_in_dir)) {
|
} 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(
|
_java_files_build_rel = exec_script(
|
||||||
"//build/android/gyp/find.py",
|
"//build/android/gyp/find.py",
|
||||||
[
|
[
|
||||||
|
@ -718,10 +726,9 @@ template("copy_ex") {
|
||||||
|
|
||||||
action(target_name) {
|
action(target_name) {
|
||||||
script = "//build/android/gyp/copy_ex.py"
|
script = "//build/android/gyp/copy_ex.py"
|
||||||
depfile = "$target_gen_dir/$target_name.d"
|
|
||||||
outputs = [
|
if (defined(invoker.deps)) { deps = invoker.deps }
|
||||||
depfile,
|
|
||||||
]
|
|
||||||
sources = []
|
sources = []
|
||||||
if (defined(invoker.sources)) {
|
if (defined(invoker.sources)) {
|
||||||
sources += invoker.sources
|
sources += invoker.sources
|
||||||
|
@ -732,18 +739,24 @@ template("copy_ex") {
|
||||||
inputs += invoker.inputs
|
inputs += invoker.inputs
|
||||||
}
|
}
|
||||||
|
|
||||||
|
depfile = "$target_gen_dir/$target_name.d"
|
||||||
|
outputs = [
|
||||||
|
depfile,
|
||||||
|
]
|
||||||
|
|
||||||
args = [
|
args = [
|
||||||
"--depfile", rebase_path(depfile, root_build_dir),
|
"--depfile", rebase_path(depfile, root_build_dir),
|
||||||
"--dest", rebase_path(invoker.dest, 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)
|
rebased_sources = rebase_path(sources, root_build_dir)
|
||||||
args += [ "--files=$rebased_sources" ]
|
args += [ "--files=$rebased_sources" ]
|
||||||
|
|
||||||
if (defined(invoker.clear_dir) && invoker.clear_dir) {
|
if (defined(invoker.clear_dir) && invoker.clear_dir) {
|
||||||
args += ["--clear"]
|
args += ["--clear"]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (defined(invoker.args)) {
|
||||||
|
args += invoker.args
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,8 +34,9 @@ template("generate_jni") {
|
||||||
assert(defined(invoker.sources))
|
assert(defined(invoker.sources))
|
||||||
assert(defined(invoker.jni_package))
|
assert(defined(invoker.jni_package))
|
||||||
jni_package = invoker.jni_package
|
jni_package = invoker.jni_package
|
||||||
base_output_dir = "${root_gen_dir}/${target_name}/${jni_package}"
|
base_output_dir = "${target_gen_dir}/${target_name}"
|
||||||
jni_output_dir = "${base_output_dir}/jni"
|
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"
|
jni_generator_include = "//base/android/jni_generator/jni_generator_helper.h"
|
||||||
|
|
||||||
|
@ -66,7 +67,13 @@ template("generate_jni") {
|
||||||
}
|
}
|
||||||
|
|
||||||
config("jni_includes_${target_name}") {
|
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) {
|
group(target_name) {
|
||||||
|
@ -79,6 +86,8 @@ template("generate_jni") {
|
||||||
if (defined(invoker.public_deps)) {
|
if (defined(invoker.public_deps)) {
|
||||||
public_deps = 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"
|
android_manifest = "//testing/android/java/AndroidManifest.xml"
|
||||||
unittests_outputs = [ unittests_binary ]
|
unittests_outputs = [ unittests_binary ]
|
||||||
native_libs = [unittests_outputs[0]]
|
native_libs = [unittests_outputs[0]]
|
||||||
|
deps = [ "//base:base_java" ]
|
||||||
if (defined(invoker.deps)) {
|
if (defined(invoker.deps)) {
|
||||||
deps = invoker.deps
|
deps += invoker.deps
|
||||||
}
|
}
|
||||||
datadeps = [
|
datadeps = [
|
||||||
"//tools/android/md5sum",
|
"//tools/android/md5sum",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче