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

Unified Diff: tools/gn/functions.cc

Issue 103593006: Allow GN imports to be processed from imports. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/functions.cc
diff --git a/tools/gn/functions.cc b/tools/gn/functions.cc
index 96bc915464c873f5e518fceb42301ca57788d63e..9851283d528a3cb9e9fabcb27ae52f51ddc6a6e3 100644
--- a/tools/gn/functions.cc
+++ b/tools/gn/functions.cc
@@ -372,10 +372,10 @@ const char kImport_Help[] =
"\n"
" By convention, imported files are named with a .gni extension.\n"
"\n"
- " It does not do an \"include\". The imported file is executed in a\n"
- " standalone environment from the caller of the import command. The\n"
- " results of this execution are cached for other files that import the\n"
- " same .gni file.\n"
+ " An import is different than a C++ \"include\". The imported file is\n"
+ " executed in a standalone environment from the caller of the import\n"
+ " command. The results of this execution are cached for other files that\n"
+ " import the same .gni file.\n"
"\n"
" Note that you can not import a BUILD.gn file that's otherwise used\n"
" in the build. Files must either be imported or implicitly loaded as\n"
@@ -383,9 +383,9 @@ const char kImport_Help[] =
"\n"
" The imported file's scope will be merged with the scope at the point\n"
" import was called. If there is a conflict (both the current scope and\n"
- " the imported file define some variable or rule with the same name)\n"
- " a runtime error will be thrown. Therefore, it's good practice to\n"
- " minimize the stuff that an imported file defines.\n"
+ " the imported file define some variable or rule with the same name but\n"
+ " different value), a runtime error will be thrown. Therefore, it's good\n"
+ " practice to minimize the stuff that an imported file defines.\n"
"\n"
"Examples:\n"
"\n"
@@ -398,8 +398,7 @@ Value RunImport(Scope* scope,
const FunctionCallNode* function,
const std::vector<Value>& args,
Err* err) {
- if (!EnsureSingleStringArg(function, args, err) ||
- !EnsureNotProcessingImport(function, scope, err))
+ if (!EnsureSingleStringArg(function, args, err))
return Value();
const SourceDir& input_dir = scope->GetSourceDir();
« no previous file with comments | « tools/gn/BUILD.gn ('k') | tools/gn/gn.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698