From e97185bf4853d56aadf362b0a00699375b1fac76 Mon Sep 17 00:00:00 2001 From: brettw Date: Tue, 19 May 2015 16:14:33 -0700 Subject: [PATCH] Revert of Fix missing GN dependencies. (patchset #4 id:60001 of https://codereview.chromium.org/1128163007/) Reason for revert: Broke Windows: http://build.chromium.org/p/chromium.win/builders/Win%20x64%20GN/builds/1568/steps/compile/logs/stdio Original issue's description: > 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 > > Committed: https://crrev.com/eadea21096be21b0d74c93f5b1a0ae6a9cc057d7 > Cr-Commit-Position: refs/heads/master@{#330636} TBR=dpranke@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=487897 Review URL: https://codereview.chromium.org/1137693006 Cr-Commit-Position: refs/heads/master@{#330650} --- build/json_schema_api.gni | 10 ++++------ build/secondary/tools/grit/grit_rule.gni | 8 +++----- chrome/BUILD.gn | 21 ++------------------- chrome/app/BUILD.gn | 3 --- chrome/browser/BUILD.gn | 1 - chrome/browser/ui/libgtk2ui/BUILD.gn | 1 - chrome/test/chromedriver/BUILD.gn | 1 - components/html_viewer/BUILD.gn | 1 - extensions/BUILD.gn | 1 - gin/BUILD.gn | 10 ++++------ mojo/mojo_application_package.gni | 9 ++------- ui/resources/BUILD.gn | 4 ++-- 12 files changed, 17 insertions(+), 53 deletions(-) diff --git a/build/json_schema_api.gni b/build/json_schema_api.gni index e1c2d33409d5..aa6365b948ee 100644 --- a/build/json_schema_api.gni +++ b/build/json_schema_api.gni @@ -154,9 +154,7 @@ template("json_schema_api") { assert(defined(invoker.impl_dir), "\"impl_dir\" must be defined for the $target_name template.") - - # Child directory inside the generated file tree. - gen_child_dir = rebase_path(invoker.impl_dir, "//") + impl_dir = invoker.impl_dir bundle_generator_registration_name = target_name + "_bundle_generator_registration" @@ -164,15 +162,15 @@ template("json_schema_api") { script = compiler_script inputs = compiler_sources + invoker.sources + uncompiled_sources outputs = [ - "$root_gen_dir/$gen_child_dir/generated_api_registration.cc", - "$root_gen_dir/$gen_child_dir/generated_api_registration.h", + "$root_gen_dir/$impl_dir/generated_api_registration.cc", + "$root_gen_dir/$impl_dir/generated_api_registration.h", ] args = [ "--root=" + rebase_path("//", root_build_dir), "--destdir=" + rebase_path(root_gen_dir, root_build_dir), "--namespace=$root_namespace", "--generator=cpp-bundle-registration", - "--impl-dir=$gen_child_dir", + "--impl-dir=" + rebase_path(impl_dir, "//"), "--include-rules=$schema_include_rules", ] + rebase_path(invoker.sources, root_build_dir) + rebase_path(uncompiled_sources, root_build_dir) diff --git a/build/secondary/tools/grit/grit_rule.gni b/build/secondary/tools/grit/grit_rule.gni index 3f22123993ac..35bbed327348 100644 --- a/build/secondary/tools/grit/grit_rule.gni +++ b/build/secondary/tools/grit/grit_rule.gni @@ -445,11 +445,9 @@ template("grit") { # depend on us. sources = grit_outputs - # Deps set on the template invocation will go on the action that runs - # grit above rather than this library. This target needs to depend on the - # action publicly so other scripts can take the outputs from the grit - # script as inputs. - public_deps = [ + # Deps set on the template invocation will go on the grit script running + # target rather than this library. + deps = [ ":$grit_custom_target", ] public_configs = [ ":$grit_config" ] diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn index 6ece001fc97c..4f962b7902bf 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -535,11 +535,6 @@ repack("packed_extra_resources") { "$root_gen_dir/content/browser/tracing/tracing_resources.pak", "$root_gen_dir/content/content_resources.pak", ] - deps += [ - "//content:resources", - "//content/browser/tracing:resources", - "//third_party/WebKit/public:resources", - ] } if (is_chromeos) { sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ] @@ -553,10 +548,7 @@ repack("packed_extra_resources") { "$root_gen_dir/extensions/extensions_renderer_resources.pak", "$root_gen_dir/extensions/extensions_resources.pak", ] - deps += [ - "//chrome/common:extensions_api_resources", - "//extensions:extensions_resources", - ] + deps += [ "//chrome/common:extensions_api_resources" ] } # GYP outputs the file in the gen/repack directory. On non-Mac/iOS platforms @@ -575,9 +567,6 @@ repack("browser_tests_pak") { "$root_gen_dir/chrome/options_test_resources.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. @@ -640,10 +629,8 @@ template("chrome_repack_percent") { deps = [ "//chrome/app/theme:theme_resources", "//chrome/renderer:resources", - "//components/resources", "//components/strings", "//net:net_resources", - "//ui/resources", ] if (!is_ios) { @@ -651,10 +638,7 @@ template("chrome_repack_percent") { "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak", "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak", ] - deps += [ - "//content/app/resources", - "//third_party/WebKit/public:image_resources", - ] + deps += [ "//content:resources" ] } if (use_ash) { sources += @@ -667,7 +651,6 @@ template("chrome_repack_percent") { } if (enable_extensions) { sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ] - deps += [ "//extensions:extensions_browser_resources" ] } output = repack_output_file diff --git a/chrome/app/BUILD.gn b/chrome/app/BUILD.gn index f552e171aaf2..b7dfb20eece9 100644 --- a/chrome/app/BUILD.gn +++ b/chrome/app/BUILD.gn @@ -158,9 +158,6 @@ action("make_generated_resources_map") { # specifying it manually. This doesn't happen in the GYP build. source_set("generated_resources_map") { sources = get_target_outputs(":make_generated_resources_map") - deps = [ - ":make_generated_resources_map", - ] } # GYP version: chrome/chrome_resources.gyp:chrome_strings diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 9f581f1c063d..1ad17a3365fb 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn @@ -851,7 +851,6 @@ grit("resources") { deps = [ ":about_credits", ":chrome_internal_resources_gen", - "//chrome/browser/ui/webui/omnibox:mojo_bindings", ] inputs = [ omnibox_mojom_file, diff --git a/chrome/browser/ui/libgtk2ui/BUILD.gn b/chrome/browser/ui/libgtk2ui/BUILD.gn index 4770c0aedef2..272f8bb91496 100644 --- a/chrome/browser/ui/libgtk2ui/BUILD.gn +++ b/chrome/browser/ui/libgtk2ui/BUILD.gn @@ -100,7 +100,6 @@ component("libgtk2ui") { "//chrome:strings", "//components/resources", "//content/public/browser", - "//mojo/environment:chromium", "//printing", "//skia", "//third_party/mojo/src/mojo/edk/system", diff --git a/chrome/test/chromedriver/BUILD.gn b/chrome/test/chromedriver/BUILD.gn index 4e318b357757..4f040b4c6756 100644 --- a/chrome/test/chromedriver/BUILD.gn +++ b/chrome/test/chromedriver/BUILD.gn @@ -95,7 +95,6 @@ source_set("automation_client_lib") { sources += get_target_outputs(":embed_user_data_dir_in_cpp") deps = [ - ":embed_extension_in_cpp", ":embed_js_in_cpp", ":embed_user_data_dir_in_cpp", "//base", diff --git a/components/html_viewer/BUILD.gn b/components/html_viewer/BUILD.gn index 1ce9f0508c1c..ec98f74f4693 100644 --- a/components/html_viewer/BUILD.gn +++ b/components/html_viewer/BUILD.gn @@ -197,7 +197,6 @@ mojo_application_package("html_viewer") { "$root_build_dir/natives_blob.bin", "$root_build_dir/snapshot_blob.bin", ] - deps += [ "//gin" ] } } diff --git a/extensions/BUILD.gn b/extensions/BUILD.gn index e0cf7a179832..8cfaea5301d4 100644 --- a/extensions/BUILD.gn +++ b/extensions/BUILD.gn @@ -120,7 +120,6 @@ repack("shell_and_test_pak") { deps = [ ":extensions_resources", "//content:resources", - "//content/app/strings", "//content/browser/devtools:devtools_resources", "//content/shell:resources", "//extensions/shell:resources", diff --git a/gin/BUILD.gn b/gin/BUILD.gn index 793ee3d8fa79..ab768ffdb770 100644 --- a/gin/BUILD.gn +++ b/gin/BUILD.gn @@ -76,8 +76,10 @@ component("gin") { "//base/third_party/dynamic_annotations", ] if (v8_use_external_startup_data && is_win) { - public_deps += [ ":gin_v8_snapshot_fingerprint" ] - deps += [ "//crypto:crypto" ] + deps += [ + ":gin_v8_snapshot_fingerprint", + "//crypto:crypto", + ] sources += [ "$target_gen_dir/v8_snapshot_fingerprint.cc" ] defines += [ "V8_VERIFY_EXTERNAL_STARTUP_DATA" ] } @@ -106,10 +108,6 @@ if (v8_use_external_startup_data) { outputs = [ output_file, ] - - deps = [ - "//v8", - ] } } diff --git a/mojo/mojo_application_package.gni b/mojo/mojo_application_package.gni index f5ace4f7fa7a..233ee97c6d96 100644 --- a/mojo/mojo_application_package.gni +++ b/mojo/mojo_application_package.gni @@ -20,18 +20,13 @@ template("mojo_application_package") { output_name = invoker.output_name } - copy_step_name = "${target_name}__copy_resources" - copy(copy_step_name) { + copy("copy_mojo_application_resources") { sources = invoker.resources outputs = [ "$root_out_dir/$output_name/resources/{{source_file_part}}", ] - if (defined(invoker.testonly)) { - testonly = invoker.testonly - } - deps = mojo_deps } - mojo_deps += [ ":$copy_step_name" ] + mojo_deps += [ ":copy_mojo_application_resources" ] } mojo_native_application(target_name) { diff --git a/ui/resources/BUILD.gn b/ui/resources/BUILD.gn index 3dbd29913587..b81dd3a72352 100644 --- a/ui/resources/BUILD.gn +++ b/ui/resources/BUILD.gn @@ -77,7 +77,7 @@ if (!is_mac) { # (copy_ui_test_pak action) if (is_ios || is_mac) { group("ui_test_pak") { - public_deps = [ + deps = [ ":repack_ui_test_pak", ":repack_ui_test_mac_locale_pack", ] @@ -90,7 +90,7 @@ if (is_ios || is_mac) { outputs = [ "$root_out_dir/ui/en-US.pak", ] - public_deps = [ + deps = [ ":repack_ui_test_pak", ] } -- 2.11.4.GIT