diff options
author | brettw <brettw@chromium.org> | 2015-06-02 10:38:29 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-06-02 17:39:11 +0000 |
commit | f883517afb9e390c40043dd67cea6fb0e69b608a (patch) | |
tree | f58da09a3caedcc2f30099cb0c93684fddb7db8a | |
parent | 53cc88da9a258bc4a34c4bff50025ee044c2e64d (diff) | |
download | chromium_src-f883517afb9e390c40043dd67cea6fb0e69b608a.zip chromium_src-f883517afb9e390c40043dd67cea6fb0e69b608a.tar.gz chromium_src-f883517afb9e390c40043dd67cea6fb0e69b608a.tar.bz2 |
Fixes for GN Android build inputs/outputs
This makes the inputs and outputs of various Android targets match the dependency tree. There are still 565 errors remaining.
Renames datadeps -> data_deps in some places.
Review URL: https://codereview.chromium.org/1149893018
Cr-Commit-Position: refs/heads/master@{#332424}
-rw-r--r-- | build/config/android/internal_rules.gni | 6 | ||||
-rw-r--r-- | build/config/android/rules.gni | 62 | ||||
-rw-r--r-- | chrome/android/BUILD.gn | 14 | ||||
-rw-r--r-- | components/resource_provider/BUILD.gn | 1 | ||||
-rw-r--r-- | content/shell/android/BUILD.gn | 4 | ||||
-rw-r--r-- | mandoline/app/android/BUILD.gn | 1 | ||||
-rw-r--r-- | mandoline/services/core_services/BUILD.gn | 1 | ||||
-rw-r--r-- | mojo/services/network/BUILD.gn | 1 |
8 files changed, 57 insertions, 33 deletions
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni index 4fd90d4..af2db44 100644 --- a/build/config/android/internal_rules.gni +++ b/build/config/android/internal_rules.gni @@ -668,6 +668,9 @@ template("create_apk") { deps = [ ":${_package_resources_target_name}", ] + if (defined(invoker.deps)) { + deps += invoker.deps + } depfile = "$target_gen_dir/$target_name.d" inputs = [ @@ -1245,6 +1248,9 @@ template("process_resources") { if (defined(invoker.args)) { args += invoker.args } + if (defined(invoker.deps)) { + deps = invoker.deps + } } } diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni index 335041d..2ebb23a 100644 --- a/build/config/android/rules.gni +++ b/build/config/android/rules.gni @@ -732,7 +732,7 @@ template("java_strings_grd_prebuilt") { # # chromium_code: If true, extra analysis warning/errors will be enabled. # -# datadeps, testonly +# data_deps, testonly # # Example # java_binary("foo") { @@ -752,8 +752,8 @@ template("java_binary") { if (defined(invoker.chromium_code)) { chromium_code = invoker.chromium_code } - if (defined(invoker.datadeps)) { - deps = invoker.datadeps + if (defined(invoker.data_deps)) { + deps = invoker.data_deps } if (defined(invoker.deps)) { deps = invoker.deps @@ -866,7 +866,7 @@ template("junit_binary") { # dependencies for this target. This will allow depending on an # android_library target, for example. # -# datadeps, testonly +# data_deps, testonly # # Example # java_library("foo_java") { @@ -894,8 +894,8 @@ template("java_library") { if (defined(invoker.chromium_code)) { chromium_code = invoker.chromium_code } - if (defined(invoker.datadeps)) { - deps = invoker.datadeps + if (defined(invoker.data_deps)) { + deps = invoker.data_deps } if (defined(invoker.deps)) { deps = invoker.deps @@ -1030,8 +1030,8 @@ template("android_library") { if (defined(invoker.chromium_code)) { chromium_code = invoker.chromium_code } - if (defined(invoker.datadeps)) { - deps = invoker.datadeps + if (defined(invoker.data_deps)) { + deps = invoker.data_deps } if (defined(invoker.deps)) { deps = invoker.deps @@ -1150,7 +1150,7 @@ template("android_java_prebuilt") { # # Variables # android_manifest: Path to AndroidManifest.xml. -# datadeps: List of dependencies needed at runtime. These will be built but +# data_deps: List of dependencies needed at runtime. These will be built but # won't change the generated .apk in any way (in fact they may be built # after the .apk is). # deps: List of dependencies. All Android java resources and libraries in the @@ -1209,8 +1209,11 @@ template("android_apk") { resources_zip_path = "$base_path.resources.zip" _all_resources_zip_path = "$base_path.resources.all.zip" jar_path = "$base_path.jar" - final_dex_path = "$gen_dir/classes.dex" _template_name = target_name + + final_dex_path = "$gen_dir/classes.dex" + final_dex_target_name = "${_template_name}__final_dex" + _final_apk_path = "" if (defined(invoker.final_apk_path)) { _final_apk_path = invoker.final_apk_path @@ -1251,11 +1254,15 @@ template("android_apk") { _load_library_from_apk = false + # The dependency that makes the chromium linker, if any is needed. + _chromium_linker_dep = [] + if (defined(invoker.native_libs)) { _use_chromium_linker = false if (defined(invoker.use_chromium_linker)) { _use_chromium_linker = invoker.use_chromium_linker && chromium_linker_supported + _chromium_linker_dep = [ "//base/android/linker:chromium_android_linker" ] } if (defined(invoker.load_library_from_apk) && @@ -1307,15 +1314,17 @@ template("android_apk") { # Help GN understand that _create_abi_split is not unused (bug in GN). assert(_create_abi_split || true) - write_build_config("${_template_name}__build_config") { + build_config_target = "${_template_name}__build_config" + write_build_config(build_config_target) { type = "android_apk" dex_path = final_dex_path resources_zip = resources_zip_path build_config = _build_config android_manifest = _android_manifest + deps = _chromium_linker_dep if (defined(invoker.deps)) { - deps = invoker.deps + deps += invoker.deps } if (defined(invoker.apk_under_test)) { @@ -1337,13 +1346,17 @@ template("android_apk") { zip_path = resources_zip_path all_resources_zip_path = _all_resources_zip_path generate_constant_ids = true - build_config = _build_config if (defined(invoker.include_all_resources)) { include_all_resources = invoker.include_all_resources } + + build_config = _build_config + deps = [ + ":$build_config_target", + ] } - _srcjar_deps += [ ":${_template_name}__process_resources" ] + _srcjar_deps += [ ":$process_resources_target" ] if (_native_libs != []) { _enable_chromium_linker_tests = false @@ -1431,8 +1444,8 @@ template("android_apk") { } } - final_deps += [ ":${_template_name}__final_dex" ] - dex("${_template_name}__final_dex") { + final_deps += [ ":$final_dex_target_name" ] + dex("$final_dex_target_name") { deps = [ ":${_template_name}__java", ] @@ -1456,7 +1469,7 @@ template("android_apk") { depfile, ] inputs = [ _build_config ] + _native_libs - deps = [] + deps = _chromium_linker_dep skip_packing_list = [ "gdbserver", "libchromium_android_linker.so", @@ -1523,6 +1536,7 @@ template("android_apk") { # This target generates the input file _all_resources_zip_path. deps = [ ":$process_resources_target", + ":$final_dex_target_name", ] if (defined(invoker.asset_location)) { @@ -1580,8 +1594,8 @@ template("android_apk") { group(target_name) { deps = final_deps - if (defined(invoker.datadeps)) { - datadeps = invoker.datadeps + if (defined(invoker.data_deps)) { + data_deps = invoker.data_deps } } } @@ -1654,14 +1668,12 @@ template("unittest_apk") { if (defined(invoker.deps)) { deps += invoker.deps } - datadeps = [ - "//tools/android/md5sum", - ] + data_deps = [ "//tools/android/md5sum" ] if (host_os == "linux") { - datadeps += [ "//tools/android/forwarder2" ] + data_deps += [ "//tools/android/forwarder2" ] } - if (defined(invoker.datadeps)) { - datadeps += invoker.datadeps + if (defined(invoker.data_deps)) { + data_deps += invoker.data_deps } } } diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 2e35d50..1a80141 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn @@ -220,9 +220,7 @@ shared_library("chrome_sync_shell") { deps = [ "//sync:test_support_sync_fake_server_android", ] - datadeps = [ - ":chrome_shell_base", - ] + data_deps = [ ":chrome_shell_base" ] } # GYP: N/A @@ -471,9 +469,7 @@ android_apk("chrome_shell_test_apk") { "//testing/android/broker:broker_java", "//ui/android:ui_javatests", ] - datadeps = [ - "//testing/android/driver:driver_apk", - ] + data_deps = [ "//testing/android/driver:driver_apk" ] apk_name = "ChromeShellTest" android_manifest = "shell/javatests/AndroidManifest.xml" } @@ -742,12 +738,18 @@ copy_ex("chrome_public_apk_assets") { if (icu_use_data_file) { sources += [ "$root_build_dir/icudtl.dat" ] } + deps = [ + "//chrome:packed_extra_resources", + "//chrome:packed_resources", + "//third_party/icu:icudata", + ] if (v8_use_external_startup_data) { sources += [ "$root_build_dir/natives_blob.bin", "$root_build_dir/snapshot_blob.bin", ] + deps += [ "//v8" ] } sources += [ "$root_build_dir/resources.pak" ] diff --git a/components/resource_provider/BUILD.gn b/components/resource_provider/BUILD.gn index cd50f51..48a0749 100644 --- a/components/resource_provider/BUILD.gn +++ b/components/resource_provider/BUILD.gn @@ -16,6 +16,7 @@ if (is_android) { input_dex_jar = java_library_path deps = [ ":java_library", + ":resource_provider_lib", ] } diff --git a/content/shell/android/BUILD.gn b/content/shell/android/BUILD.gn index c52b46c..8af8c29 100644 --- a/content/shell/android/BUILD.gn +++ b/content/shell/android/BUILD.gn @@ -109,7 +109,7 @@ copy_ex("copy_content_shell_assets") { android_apk("content_shell_apk") { use_chromium_linker = true testonly = true - datadeps = [ + data_deps = [ # "//tools/android/forwarder", ] deps = [ @@ -157,7 +157,7 @@ android_apk("content_shell_test_apk") { "//net/android:net_javatests", "//testing/android/broker:broker_java", ] - datadeps = [ + data_deps = [ ":content_shell_apk", "//testing/android/driver:driver_apk", ] diff --git a/mandoline/app/android/BUILD.gn b/mandoline/app/android/BUILD.gn index 56dfa62..7c3c34b 100644 --- a/mandoline/app/android/BUILD.gn +++ b/mandoline/app/android/BUILD.gn @@ -54,6 +54,7 @@ copy_ex("copy_mandoline_assets") { "//components/view_manager", "//components/view_manager/surfaces", "//mandoline/services/core_services", + "//mojo/runner:bootstrap", "//mojo/runner:bootstrap_java", "//mojo/services/network", ] diff --git a/mandoline/services/core_services/BUILD.gn b/mandoline/services/core_services/BUILD.gn index be926ed..3964619 100644 --- a/mandoline/services/core_services/BUILD.gn +++ b/mandoline/services/core_services/BUILD.gn @@ -19,6 +19,7 @@ if (is_android) { input_dex_jar = java_library_path deps = [ ":java_library", + ":native_library", ] } diff --git a/mojo/services/network/BUILD.gn b/mojo/services/network/BUILD.gn index 9fe97cf..b7a9573 100644 --- a/mojo/services/network/BUILD.gn +++ b/mojo/services/network/BUILD.gn @@ -15,6 +15,7 @@ if (is_android) { input_dex_jar = java_library_path deps = [ ":java_library", + ":native_library", ] } |