Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(901)

Side by Side Diff: tools/gn/variables.cc

Issue 552843005: Convert GN visibility to be a list. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/visibility.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/variables.h" 5 #include "tools/gn/variables.h"
6 6
7 namespace variables { 7 namespace variables {
8 8
9 // Built-in variables ---------------------------------------------------------- 9 // Built-in variables ----------------------------------------------------------
10 10
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
816 " testonly = true\n" 816 " testonly = true\n"
817 " ...\n" 817 " ...\n"
818 " }\n"; 818 " }\n";
819 819
820 const char kVisibility[] = "visibility"; 820 const char kVisibility[] = "visibility";
821 const char kVisibility_HelpShort[] = 821 const char kVisibility_HelpShort[] =
822 "visibility: [label list] A list of labels that can depend on a target."; 822 "visibility: [label list] A list of labels that can depend on a target.";
823 const char kVisibility_Help[] = 823 const char kVisibility_Help[] =
824 "visibility: A list of labels that can depend on a target.\n" 824 "visibility: A list of labels that can depend on a target.\n"
825 "\n" 825 "\n"
826 " A label or a list of labels and label patterns that define which\n" 826 " A list of labels and label patterns that define which targets can\n"
827 " targets can depend on the current one. These permissions are checked\n" 827 " depend on the current one. These permissions are checked via the\n"
828 " via then \"check\" command (see \"gn help check\").\n" 828 " \"check\" command (see \"gn help check\").\n"
829 "\n" 829 "\n"
830 " If visibility is not defined, it defaults to public (\"*\").\n" 830 " If visibility is not defined, it defaults to public (\"*\").\n"
831 "\n" 831 "\n"
832 " If visibility is defined, only the targets with labels that match it\n" 832 " If visibility is defined, only the targets with labels that match it\n"
833 " can depend on the current target. The empty list means no targets\n" 833 " can depend on the current target. The empty list means no targets\n"
834 " can depend on the current target.\n" 834 " can depend on the current target.\n"
835 "\n" 835 "\n"
836 " Tip: Often you will want the same visibility for all targets in a\n" 836 " Tip: Often you will want the same visibility for all targets in a\n"
837 " BUILD file. In this case you can just put the definition at the top,\n" 837 " BUILD file. In this case you can just put the definition at the top,\n"
838 " outside of any target, and the targets will inherit that scope and see\n" 838 " outside of any target, and the targets will inherit that scope and see\n"
839 " the definition.\n" 839 " the definition.\n"
840 "\n" 840 "\n"
841 "Patterns\n" 841 "Patterns\n"
842 "\n" 842 "\n"
843 " See \"gn help label_pattern\" for more details on what types of\n" 843 " See \"gn help label_pattern\" for more details on what types of\n"
844 " patterns are supported. If a toolchain is specified, only targets\n" 844 " patterns are supported. If a toolchain is specified, only targets\n"
845 " in that toolchain will be matched. If a toolchain is not specified on\n" 845 " in that toolchain will be matched. If a toolchain is not specified on\n"
846 " a pattern, targets in all toolchains will be matched.\n" 846 " a pattern, targets in all toolchains will be matched.\n"
847 "\n" 847 "\n"
848 "Examples\n" 848 "Examples\n"
849 "\n" 849 "\n"
850 " Only targets in the current buildfile (\"private\", the default):\n" 850 " Only targets in the current buildfile (\"private\", the default):\n"
851 " visibility = \":*\"\n" 851 " visibility = [ \":*\" ]\n"
852 "\n" 852 "\n"
853 " No targets (used for targets that should be leaf nodes):\n" 853 " No targets (used for targets that should be leaf nodes):\n"
854 " visibility = []\n" 854 " visibility = []\n"
855 "\n" 855 "\n"
856 " Any target (\"public\"):\n" 856 " Any target (\"public\"):\n"
857 " visibility = \"*\"\n" 857 " visibility = [ \"*\" ]\n"
858 "\n" 858 "\n"
859 " All targets in the current directory and any subdirectory:\n" 859 " All targets in the current directory and any subdirectory:\n"
860 " visibility = \"./*\"\n" 860 " visibility = [ \"./*\" ]\n"
861 "\n" 861 "\n"
862 " Any target in \"//bar/BUILD.gn\":\n" 862 " Any target in \"//bar/BUILD.gn\":\n"
863 " visibility = \"//bar:*\"\n" 863 " visibility = [ \"//bar:*\" ]\n"
864 "\n" 864 "\n"
865 " Any target in \"//bar/\" or any subdirectory thereof:\n" 865 " Any target in \"//bar/\" or any subdirectory thereof:\n"
866 " visibility = \"//bar/*\"\n" 866 " visibility = [ \"//bar/*\"\n ]"
867 "\n" 867 "\n"
868 " Just these specific targets:\n" 868 " Just these specific targets:\n"
869 " visibility = [ \":mything\", \"//foo:something_else\" ]\n" 869 " visibility = [ \":mything\", \"//foo:something_else\" ]\n"
870 "\n" 870 "\n"
871 " Any target in the current directory and any subdirectory thereof, plus\n" 871 " Any target in the current directory and any subdirectory thereof, plus\n"
872 " any targets in \"//bar/\" and any subdirectory thereof.\n" 872 " any targets in \"//bar/\" and any subdirectory thereof.\n"
873 " visibility = [ \"./*\", \"//bar/*\" ]\n"; 873 " visibility = [ \"./*\", \"//bar/*\" ]\n";
874 874
875 // ----------------------------------------------------------------------------- 875 // -----------------------------------------------------------------------------
876 876
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 INSERT_VARIABLE(Sources) 939 INSERT_VARIABLE(Sources)
940 INSERT_VARIABLE(Testonly) 940 INSERT_VARIABLE(Testonly)
941 INSERT_VARIABLE(Visibility) 941 INSERT_VARIABLE(Visibility)
942 } 942 }
943 return info_map; 943 return info_map;
944 } 944 }
945 945
946 #undef INSERT_VARIABLE 946 #undef INSERT_VARIABLE
947 947
948 } // namespace variables 948 } // namespace variables
OLDNEW
« no previous file with comments | « tools/gn/functions.cc ('k') | tools/gn/visibility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698