Commit eadea210 authored by brettw's avatar brettw Committed by Commit bot

Fix missing GN dependencies.

Fixes some cases where a dependency between a target's inputs and outputs exists without an explicit dependency.

json_schema_api.gni was generating wrong names, this was fixed.

mojo_application_package.gni was fixed to generate unique names (just a bug I noticed in passing) and support the testonly flag, which is necessary when I added the correct dependency.

The rest of the cases are just adding deps or making existing deps public so that the ability to depend on the target's outputs is passed to dependents.

BUG=487897

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

Cr-Commit-Position: refs/heads/master@{#330636}
parent 16895a08
...@@ -154,7 +154,9 @@ template("json_schema_api") { ...@@ -154,7 +154,9 @@ template("json_schema_api") {
assert(defined(invoker.impl_dir), assert(defined(invoker.impl_dir),
"\"impl_dir\" must be defined for the $target_name template.") "\"impl_dir\" must be defined for the $target_name template.")
impl_dir = invoker.impl_dir
# Child directory inside the generated file tree.
gen_child_dir = rebase_path(invoker.impl_dir, "//")
bundle_generator_registration_name = bundle_generator_registration_name =
target_name + "_bundle_generator_registration" target_name + "_bundle_generator_registration"
...@@ -162,15 +164,15 @@ template("json_schema_api") { ...@@ -162,15 +164,15 @@ template("json_schema_api") {
script = compiler_script script = compiler_script
inputs = compiler_sources + invoker.sources + uncompiled_sources inputs = compiler_sources + invoker.sources + uncompiled_sources
outputs = [ outputs = [
"$root_gen_dir/$impl_dir/generated_api_registration.cc", "$root_gen_dir/$gen_child_dir/generated_api_registration.cc",
"$root_gen_dir/$impl_dir/generated_api_registration.h", "$root_gen_dir/$gen_child_dir/generated_api_registration.h",
] ]
args = [ args = [
"--root=" + rebase_path("//", root_build_dir), "--root=" + rebase_path("//", root_build_dir),
"--destdir=" + rebase_path(root_gen_dir, root_build_dir), "--destdir=" + rebase_path(root_gen_dir, root_build_dir),
"--namespace=$root_namespace", "--namespace=$root_namespace",
"--generator=cpp-bundle-registration", "--generator=cpp-bundle-registration",
"--impl-dir=" + rebase_path(impl_dir, "//"), "--impl-dir=$gen_child_dir",
"--include-rules=$schema_include_rules", "--include-rules=$schema_include_rules",
] + rebase_path(invoker.sources, root_build_dir) + ] + rebase_path(invoker.sources, root_build_dir) +
rebase_path(uncompiled_sources, root_build_dir) rebase_path(uncompiled_sources, root_build_dir)
......
...@@ -445,9 +445,11 @@ template("grit") { ...@@ -445,9 +445,11 @@ template("grit") {
# depend on us. # depend on us.
sources = grit_outputs sources = grit_outputs
# Deps set on the template invocation will go on the grit script running # Deps set on the template invocation will go on the action that runs
# target rather than this library. # grit above rather than this library. This target needs to depend on the
deps = [ # action publicly so other scripts can take the outputs from the grit
# script as inputs.
public_deps = [
":$grit_custom_target", ":$grit_custom_target",
] ]
public_configs = [ ":$grit_config" ] public_configs = [ ":$grit_config" ]
......
...@@ -535,6 +535,11 @@ repack("packed_extra_resources") { ...@@ -535,6 +535,11 @@ repack("packed_extra_resources") {
"$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
"$root_gen_dir/content/content_resources.pak", "$root_gen_dir/content/content_resources.pak",
] ]
deps += [
"//content:resources",
"//content/browser/tracing:resources",
"//third_party/WebKit/public:resources",
]
} }
if (is_chromeos) { if (is_chromeos) {
sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ] sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
...@@ -548,7 +553,10 @@ repack("packed_extra_resources") { ...@@ -548,7 +553,10 @@ repack("packed_extra_resources") {
"$root_gen_dir/extensions/extensions_renderer_resources.pak", "$root_gen_dir/extensions/extensions_renderer_resources.pak",
"$root_gen_dir/extensions/extensions_resources.pak", "$root_gen_dir/extensions/extensions_resources.pak",
] ]
deps += [ "//chrome/common:extensions_api_resources" ] deps += [
"//chrome/common:extensions_api_resources",
"//extensions:extensions_resources",
]
} }
# GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms
...@@ -567,6 +575,9 @@ repack("browser_tests_pak") { ...@@ -567,6 +575,9 @@ repack("browser_tests_pak") {
"$root_gen_dir/chrome/options_test_resources.pak", "$root_gen_dir/chrome/options_test_resources.pak",
] ]
output = "$root_out_dir/browser_tests.pak" output = "$root_out_dir/browser_tests.pak"
deps = [
"//chrome/browser/resources:options_test_resources",
]
} }
# Collects per-locale grit files from many sources into global per-locale files. # Collects per-locale grit files from many sources into global per-locale files.
...@@ -629,8 +640,10 @@ template("chrome_repack_percent") { ...@@ -629,8 +640,10 @@ template("chrome_repack_percent") {
deps = [ deps = [
"//chrome/app/theme:theme_resources", "//chrome/app/theme:theme_resources",
"//chrome/renderer:resources", "//chrome/renderer:resources",
"//components/resources",
"//components/strings", "//components/strings",
"//net:net_resources", "//net:net_resources",
"//ui/resources",
] ]
if (!is_ios) { if (!is_ios) {
...@@ -638,7 +651,10 @@ template("chrome_repack_percent") { ...@@ -638,7 +651,10 @@ template("chrome_repack_percent") {
"$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak", "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
"$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak", "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
] ]
deps += [ "//content:resources" ] deps += [
"//content/app/resources",
"//third_party/WebKit/public:image_resources",
]
} }
if (use_ash) { if (use_ash) {
sources += sources +=
...@@ -651,6 +667,7 @@ template("chrome_repack_percent") { ...@@ -651,6 +667,7 @@ template("chrome_repack_percent") {
} }
if (enable_extensions) { if (enable_extensions) {
sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ] sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
deps += [ "//extensions:extensions_browser_resources" ]
} }
output = repack_output_file output = repack_output_file
......
...@@ -158,6 +158,9 @@ action("make_generated_resources_map") { ...@@ -158,6 +158,9 @@ action("make_generated_resources_map") {
# specifying it manually. This doesn't happen in the GYP build. # specifying it manually. This doesn't happen in the GYP build.
source_set("generated_resources_map") { source_set("generated_resources_map") {
sources = get_target_outputs(":make_generated_resources_map") sources = get_target_outputs(":make_generated_resources_map")
deps = [
":make_generated_resources_map",
]
} }
# GYP version: chrome/chrome_resources.gyp:chrome_strings # GYP version: chrome/chrome_resources.gyp:chrome_strings
......
...@@ -851,6 +851,7 @@ grit("resources") { ...@@ -851,6 +851,7 @@ grit("resources") {
deps = [ deps = [
":about_credits", ":about_credits",
":chrome_internal_resources_gen", ":chrome_internal_resources_gen",
"//chrome/browser/ui/webui/omnibox:mojo_bindings",
] ]
inputs = [ inputs = [
omnibox_mojom_file, omnibox_mojom_file,
......
...@@ -100,6 +100,7 @@ component("libgtk2ui") { ...@@ -100,6 +100,7 @@ component("libgtk2ui") {
"//chrome:strings", "//chrome:strings",
"//components/resources", "//components/resources",
"//content/public/browser", "//content/public/browser",
"//mojo/environment:chromium",
"//printing", "//printing",
"//skia", "//skia",
"//third_party/mojo/src/mojo/edk/system", "//third_party/mojo/src/mojo/edk/system",
......
...@@ -95,6 +95,7 @@ source_set("automation_client_lib") { ...@@ -95,6 +95,7 @@ source_set("automation_client_lib") {
sources += get_target_outputs(":embed_user_data_dir_in_cpp") sources += get_target_outputs(":embed_user_data_dir_in_cpp")
deps = [ deps = [
":embed_extension_in_cpp",
":embed_js_in_cpp", ":embed_js_in_cpp",
":embed_user_data_dir_in_cpp", ":embed_user_data_dir_in_cpp",
"//base", "//base",
......
...@@ -197,6 +197,7 @@ mojo_application_package("html_viewer") { ...@@ -197,6 +197,7 @@ mojo_application_package("html_viewer") {
"$root_build_dir/natives_blob.bin", "$root_build_dir/natives_blob.bin",
"$root_build_dir/snapshot_blob.bin", "$root_build_dir/snapshot_blob.bin",
] ]
deps += [ "//gin" ]
} }
} }
......
...@@ -120,6 +120,7 @@ repack("shell_and_test_pak") { ...@@ -120,6 +120,7 @@ repack("shell_and_test_pak") {
deps = [ deps = [
":extensions_resources", ":extensions_resources",
"//content:resources", "//content:resources",
"//content/app/strings",
"//content/browser/devtools:devtools_resources", "//content/browser/devtools:devtools_resources",
"//content/shell:resources", "//content/shell:resources",
"//extensions/shell:resources", "//extensions/shell:resources",
......
...@@ -76,10 +76,8 @@ component("gin") { ...@@ -76,10 +76,8 @@ component("gin") {
"//base/third_party/dynamic_annotations", "//base/third_party/dynamic_annotations",
] ]
if (v8_use_external_startup_data && is_win) { if (v8_use_external_startup_data && is_win) {
deps += [ public_deps += [ ":gin_v8_snapshot_fingerprint" ]
":gin_v8_snapshot_fingerprint", deps += [ "//crypto:crypto" ]
"//crypto:crypto",
]
sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ] sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ]
defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ] defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ]
} }
...@@ -108,6 +106,10 @@ if (v8_use_external_startup_data) { ...@@ -108,6 +106,10 @@ if (v8_use_external_startup_data) {
outputs = [ outputs = [
output_file, output_file,
] ]
deps = [
"//v8",
]
} }
} }
......
...@@ -20,13 +20,18 @@ template("mojo_application_package") { ...@@ -20,13 +20,18 @@ template("mojo_application_package") {
output_name = invoker.output_name output_name = invoker.output_name
} }
copy("copy_mojo_application_resources") { copy_step_name = "${target_name}__copy_resources"
copy(copy_step_name) {
sources = invoker.resources sources = invoker.resources
outputs = [ outputs = [
"$root_out_dir/$output_name/resources/{{source_file_part}}", "$root_out_dir/$output_name/resources/{{source_file_part}}",
] ]
if (defined(invoker.testonly)) {
testonly = invoker.testonly
}
deps = mojo_deps
} }
mojo_deps += [ ":copy_mojo_application_resources" ] mojo_deps += [ ":$copy_step_name" ]
} }
mojo_native_application(target_name) { mojo_native_application(target_name) {
......
...@@ -77,7 +77,7 @@ if (!is_mac) { ...@@ -77,7 +77,7 @@ if (!is_mac) {
# (copy_ui_test_pak action) # (copy_ui_test_pak action)
if (is_ios || is_mac) { if (is_ios || is_mac) {
group("ui_test_pak") { group("ui_test_pak") {
deps = [ public_deps = [
":repack_ui_test_pak", ":repack_ui_test_pak",
":repack_ui_test_mac_locale_pack", ":repack_ui_test_mac_locale_pack",
] ]
...@@ -90,7 +90,7 @@ if (is_ios || is_mac) { ...@@ -90,7 +90,7 @@ if (is_ios || is_mac) {
outputs = [ outputs = [
"$root_out_dir/ui/en-US.pak", "$root_out_dir/ui/en-US.pak",
] ]
deps = [ public_deps = [
":repack_ui_test_pak", ":repack_ui_test_pak",
] ]
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment