Commit 9af4262a authored by brettw's avatar brettw Committed by Commit bot

Convert GN visibility variables to lists.

Currently this is either a list or a string. However, this is causing some problems because templates can't add to the invoker's visibility list without knowing if the original is a string or a list.

In an effort to make this consistent, I'm converting all visibiltiy to be lists, and will remove support for strings in a future build.

This exempts cld from header checking since it was confusing GN's header checker. It adds a ppapi header target as well that will be used by libyuv (that requires a roll).

TBR=scottmg

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

Cr-Commit-Position: refs/heads/master@{#293638}
parent 0d9c7742
......@@ -240,7 +240,7 @@ if (!is_android) {
} # !is_android
source_set("allocator_extension_thunks") {
visibility = "//base/*"
visibility = [ "//base/*" ]
sources = [
"allocator_extension_thunks.cc",
"allocator_extension_thunks.h",
......
......@@ -3,7 +3,7 @@
# found in the LICENSE file.
source_set("nspr") {
visibility = "//base/*"
visibility = [ "//base/*" ]
sources = [
"prtime.cc",
"prtime.h",
......
......@@ -3,7 +3,7 @@
# found in the LICENSE file.
source_set("symbolize") {
visibility = "//base/*"
visibility = [ "//base/*" ]
sources = [
"config.h",
"demangle.cc",
......
......@@ -3,7 +3,7 @@
# found in the LICENSE file.
source_set("xdg_mime") {
visibility = "//base/*"
visibility = [ "//base/*" ]
sources = [
"xdgmime.c",
"xdgmime.h",
......
......@@ -3,7 +3,7 @@
# found in the LICENSE file.
source_set("xdg_user_dirs") {
visibility = "//base/*"
visibility = [ "//base/*" ]
sources = [
"xdg_user_dir_lookup.cc",
"xdg_user_dir_lookup.h",
......
......@@ -54,7 +54,7 @@ config("gtest_config") {
}
config("gtest_direct_config") {
visibility = ":*"
visibility = [ ":*" ]
defines = [ "UNIT_TEST" ]
}
......
......@@ -6,7 +6,7 @@ import("//third_party/protobuf/proto_library.gni")
proto_library("cacheinvalidation_proto_cpp") {
# Depend on cacheinvalidation instead.
visibility = "//third_party/cacheinvalidation/*"
visibility = [ "//third_party/cacheinvalidation/*" ]
sources = [
"client.proto",
......
......@@ -385,7 +385,7 @@ if (is_linux) {
# TODO(rsleevi): http://crbug.com/128134 - Break the circular dependency
# without requiring nssckbi to be built as a shared library.
source_set("nssckbi") {
visibility = ":nss" # This target is internal implementation detail.
visibility = [ ":nss" ] # This target is internal implementation detail.
sources = [
"nss/lib/ckfw/builtins/anchor.c",
......
......@@ -258,7 +258,7 @@ template("grit") {
# The config and the action below get this visibility son only the generated
# source set can depend on them. The variable "target_name" will get
# overwritten inside the inner classes so we need to compute it here.
target_visibility = ":$target_name"
target_visibility = [ ":$target_name" ]
# The current grit setup makes an file in $output_dir/grit/foo.h that
# the source code expects to include via "grit/foo.h". It would be nice to
......@@ -301,7 +301,16 @@ template("grit") {
args += grit_flags + assert_files_flags
visibility = target_visibility
if (defined(invoker.visibility)) {
# This needs to include both what the invoker specified (since they
# probably include generated headers from this target), as well as the
# generated source set (since there's no guarantee that the visibility
# specified by the invoker includes our target).
#
# Only define visibility at all if the invoker specified it. Otherwise,
# we want to keep the public "no visibility specified" default.
visibility = target_visibility + invoker.visibility
}
deps = [ "//tools/grit:grit_sources" ]
if (defined(invoker.deps)) {
......
......@@ -37,7 +37,7 @@ template("midl") {
type_library_file = "{{source_name_part}}.tlb"
action_foreach(action_name) {
visibility = ":$source_set_name"
visibility = [ ":$source_set_name" ]
# This functionality is handled by the win-tool because the GYP build has
# MIDL support built-in.
......
......@@ -319,7 +319,7 @@ group("packed_resources") {
}
repack("packed_extra_resources") {
visibility = ":*"
visibility = [ ":*" ]
sources = [
"$root_gen_dir/chrome/browser_resources.pak",
"$root_gen_dir/chrome/app/theme/chrome_unscaled_resources.pak",
......
......@@ -72,7 +72,7 @@ grit("generated_resources") {
# GYP version: chrome/chrome_resources.gyp:chrome_strings_map
action("make_generated_resources_map") {
# Targets should depend on generated_resources_map instead.
visibility = ":generated_resources_map"
visibility = [ ":generated_resources_map" ]
script = "//chrome/browser/metrics/variations/generate_resources_map.py"
......
......@@ -150,7 +150,7 @@ template("chrome_repack_locales") {
locale_targets += [ ":$current_name" ]
_repack_one_locale(current_name) {
visibility = ":$group_target_name"
visibility = [ ":$group_target_name" ]
locale = input_locale
# Compute the output name. Mac uses a different location.
......
......@@ -244,7 +244,7 @@ if (is_linux) {
# Windows.
import("//chrome/version.gni")
process_version("version") {
visibility = ":common"
visibility = [ ":common" ]
source = "chrome_version_info_posix.h.version"
output = "$target_gen_dir/chrome_version_info_posix.h"
}
......
......@@ -7,7 +7,7 @@ import("//build/config/features.gni")
# Collection of all components. You wouldn't link to this, but this is rather
# to reference the files so they can be compiled by the build system.
group("all_components") {
visibility = "//:*" # Only for the root targets to bring in.
visibility = [ "//:*" ] # Only for the root targets to bring in.
deps = [
"//components/auto_login_parser",
......
......@@ -17,7 +17,7 @@ config("autofill_browser_config") {
# GYP version: components/autofill.gyp:autofill_regexes
action("regexes") {
visibility = "//components/autofill/*"
visibility = [ "//components/autofill/*" ]
script = "//build/escape_unicode.py"
inputs = [
......
......@@ -3,7 +3,7 @@
# found in the LICENSE file.
action("bake_in_configs") {
visibility = ":*"
visibility = [ ":*" ]
script = "bake_in_configs.py"
inputs = [
......
......@@ -73,7 +73,7 @@ static_library("search_engines") {
}
json_to_struct("prepopulated_engines") {
visibility = ":*"
visibility = [ ":*" ]
source = "prepopulated_engines.json"
schema_file = "prepopulated_engines_schema.json"
......
......@@ -49,7 +49,7 @@ grit("resources") {
# This target exists to "hold" the content_export header so we can do proper
# inclusion testing of it.
source_set("export") {
visibility = "//content/*"
visibility = [ "//content/*" ]
sources = [
"content/common/content_export.h"
]
......
......@@ -37,7 +37,7 @@ grit("devtools_resources") {
}
action("gen_devtools_protocol_constants") {
visibility = ":devtools_protocol_constants"
visibility = [ ":devtools_protocol_constants" ]
script = "//content/public/browser/devtools_protocol_constants_generator.py"
......@@ -57,6 +57,6 @@ action("gen_devtools_protocol_constants") {
}
source_set("devtools_protocol_constants") {
visibility = ":resources"
visibility = [ ":resources" ]
sources = get_target_outputs(":gen_devtools_protocol_constants")
}
......@@ -12,7 +12,7 @@ tracing_gen_dir = "$root_gen_dir/content/browser/tracing"
tracing_grd = "$tracing_gen_dir/tracing_resources.grd"
action("generate_tracing_grd") {
visibility = ":*"
visibility = [ ":*" ]
script = "generate_trace_viewer_grd.py"
input_pages = [
......
......@@ -7,7 +7,7 @@ import("//build/config/features.gni")
# This is the NPAPI plugin process. It isn't used on Linux.
if (enable_plugins && !is_linux) {
source_set("plugin") {
visibility = "//content/*"
visibility = [ "//content/*" ]
sources = [
"plugin_channel.cc",
"plugin_channel.h",
......
......@@ -316,7 +316,7 @@ static_library("content_shell_lib") {
}
grit("content_shell_resources_grit") {
visibility = ":*"
visibility = [ ":*" ]
source = "shell_resources.grd"
outputs = [
"grit/shell_resources.h",
......@@ -336,14 +336,14 @@ copy("copy_shell_resources") {
# Font copies.
if (!is_mac) {
copy("copy_ahem") {
visibility = ":*"
visibility = [ ":*" ]
sources = [ "renderer/test_runner/resources/fonts/AHEM____.TTF" ]
outputs = [ "$root_out_dir/AHEM____.TTF" ]
}
}
if (use_x11) {
copy("copy_x11_fonts") {
visibility = ":*"
visibility = [ ":*" ]
sources = [
"renderer/test_runner/resources/fonts/fonts.conf",
"//third_party/gardiner_mod/GardinerModBug.ttf",
......@@ -354,7 +354,7 @@ if (use_x11) {
}
if (is_android) {
copy("copy_android_fonts") {
visibility = ":*"
visibility = [ ":*" ]
sources = [
"renderer/test_runner/resources/fonts/android_main_fonts.xml",
"renderer/test_runner/resources/fonts/android_fallback_fonts.xml",
......
......@@ -67,7 +67,7 @@ template("generated_extensions_api") {
# Keep a copy of the target_name here since it will be trampled
# in nested targets.
target_visibility = ":$target_name"
target_visibility = [ ":$target_name" ]
generated_config_name = target_name + "_generated_config"
config(generated_config_name) {
......
......@@ -58,7 +58,7 @@ component("gcm") {
}
proto_library("proto") {
visibility = ":*"
visibility = [ ":*" ]
sources = [
"protocol/android_checkin.proto",
"protocol/checkin.proto",
......
......@@ -18,7 +18,7 @@ source_set("proto") {
}
proto_library("cast_logging_proto") {
visibility = ":proto"
visibility = [ ":proto" ]
sources = [
"raw_events.proto",
]
......
......@@ -18,7 +18,7 @@ source_set("proto") {
}
proto_library("cast_network_simulation_proto") {
visibility = ":proto"
visibility = [ ":proto" ]
sources = [
"network_simulation_model.proto",
]
......
......@@ -25,7 +25,7 @@ source_set("chromium") {
# GYP version: mojo_base.gyp:mojo_environment_chromium_impl
component("chromium_impl") {
output_name = "mojo_environment_impl"
visibility = "//mojo/*"
visibility = [ "//mojo/*" ]
sources = [
"default_async_waiter_impl.cc",
......
......@@ -75,11 +75,18 @@ template("mojom") {
"{{source_gen_dir}}/{{source_name_part}}_mojom.py",
]
target_visibility = ":$target_name"
if (defined(invoker.visibility)) {
# Need to save this because the the target_name is overwritten inside the
# action to be that of the action itself. Only define this in the case the
# var is used to avoid unused var error.
target_visibility = [ ":$target_name" ]
}
generator_target_name = target_name + "_generator"
action_foreach(generator_target_name) {
visibility = target_visibility
if (defined(invoker.visibility)) {
visibility = target_visibility + invoker.visibility
}
script = generator_script
inputs = generator_sources
sources = invoker.sources
......
......@@ -20,6 +20,12 @@ source_set("ppapi_c") {
sources = gypi_values.c_source_files
}
# Some targets need to depend on the PPAPI version only. This target exists so
# they can include this header without header check warnings.
source_set("ppapi_macros") {
sources = [ "c/pp_macros.h" ]
}
source_set("ppapi_cpp_objects") {
sources = gypi_values.cpp_source_files
......
......@@ -699,5 +699,5 @@ source_set("skia_opts") {
"//base",
]
visibility = ":skia"
visibility = [ ":skia" ]
}
......@@ -15,7 +15,7 @@ config("openssl_config") {
# Config internal to this build file.
config("openssl_internal_config") {
visibility = ":*" # Only targets in this file can depend on this.
visibility = [ ":*" ] # Only targets in this file can depend on this.
}
# The list of BoringSSL files is kept in boringssl.gypi.
......
......@@ -8,6 +8,10 @@ config("cld_config") {
}
static_library("cld") {
# This target includes its own copy of "base" which confuses the header
# checker.
check_includes = false
sources = [
"encodings/compact_lang_det/cldutil.cc",
"encodings/compact_lang_det/cldutil.h",
......
......@@ -15,7 +15,7 @@ source_set("proto") {
}
proto_library("dom_distiller_proto") {
visibility = ":*"
visibility = [ ":*" ]
sources = [ "package/proto/dom_distiller.proto" ]
proto_out_dir = "third_party/dom_distiller_js"
}
......@@ -105,7 +105,8 @@ source_set("protobuf_lite") {
# into that category. Do not use in Chrome code.
source_set("protobuf_full") {
visibility = ":*" # Prevent people from depending on this outside our file.
# Prevent people from depending on this outside our file.
visibility = [ ":*" ]
sources = protobuf_lite_sources
sources += [
......
......@@ -55,7 +55,7 @@ template("proto_library") {
action_name = "${target_name}_gen"
source_set_name = target_name
action_foreach(action_name) {
visibility = ":$source_set_name"
visibility = [ ":$source_set_name" ]
script = "//tools/protoc_wrapper/protoc_wrapper.py"
......
......@@ -110,7 +110,8 @@ template("yasm_assemble") {
source_set_name = target_name
action_foreach(action_name) {
visibility = ":$source_set_name" # Only the source set can depend on this.
# Only the source set can depend on this.
visibility = [ ":$source_set_name" ]
script = "//third_party/yasm/run_yasm.py"
sources = invoker.sources
......
......@@ -15,7 +15,7 @@ template("generate_library_loader") {
output_h = "$root_gen_dir/library_loaders/" + invoker.output_h
output_cc = "$root_gen_dir/library_loaders/" + invoker.output_cc
action_visibility = ":$target_name"
action_visibility = [ ":$target_name" ]
action("${target_name}_loader") {
visibility = action_visibility
......
......@@ -258,7 +258,7 @@ component("gl") {
}
action("generate_gl_bindings") {
visibility = ":*" # Only targets in this file can see this.
visibility = [ ":*" ] # Only targets in this file can see this.
script = "generate_bindings.py"
......
......@@ -13,7 +13,7 @@ mojom("mojo_bindings") {
# GYP version: part of ui/keyboard/keyboard.gyp:keyboard
source_set("webui") {
visibility = "//ui/keyboard"
visibility = [ "//ui/keyboard" ]
sources = [
"../keyboard_export.h",
......
......@@ -15,7 +15,6 @@ group("resources") {
}
grit("ui_resources_grd") {
visibility = ":resources"
source = "ui_resources.grd"
outputs = [
"grit/ui_resources.h",
......@@ -27,7 +26,6 @@ grit("ui_resources_grd") {
}
grit("ui_unscaled_resources_grd") {
visibility = ":resources"
source = "ui_unscaled_resources.grd"
outputs = [
"grit/ui_unscaled_resources.h",
......@@ -36,7 +34,6 @@ grit("ui_unscaled_resources_grd") {
}
grit("webui_resources_grd") {
visibility = ":resources"
source = "../webui/resources/webui_resources.grd"
outputs = [
"grit/webui_resources.h",
......@@ -74,7 +71,7 @@ if (is_ios) {
# GYP version: ui/resources/ui_resources.gyp:ui_test_pak
repack("repack_ui_test_pak") {
# Depend on ui_test_pak instead of this one.
visibility = ":ui_test_pak"
visibility = [ ":ui_test_pak" ]
sources = [
"$root_gen_dir/ui/resources/ui_resources_100_percent.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