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

Unified Diff: tools/gn/filesystem_utils.cc

Issue 429423002: Refactor GN source expansions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/filesystem_utils.h ('k') | tools/gn/filesystem_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/filesystem_utils.cc
diff --git a/tools/gn/filesystem_utils.cc b/tools/gn/filesystem_utils.cc
index 097a2276b225003214253be93a479207a360c0c6..c1e3200209c49467ee80ad99fda10f299d2bd410 100644
--- a/tools/gn/filesystem_utils.cc
+++ b/tools/gn/filesystem_utils.cc
@@ -11,7 +11,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
-#include "tools/gn/file_template.h"
#include "tools/gn/location.h"
#include "tools/gn/settings.h"
#include "tools/gn/source_dir.h"
@@ -335,7 +334,6 @@ base::StringPiece FindLastDirComponent(const SourceDir& dir) {
bool EnsureStringIsInOutputDir(const SourceDir& dir,
const std::string& str,
const Value& originating,
- bool allow_templates,
Err* err) {
// This check will be wrong for all proper prefixes "e.g. "/output" will
// match "/out" but we don't really care since this is just a sanity check.
@@ -343,14 +341,6 @@ bool EnsureStringIsInOutputDir(const SourceDir& dir,
if (str.compare(0, dir_str.length(), dir_str) == 0)
return true; // Output directory is hardcoded.
- if (allow_templates) {
- // Allow the string to begin with any source expansion inside the output
- // directory.
- if (StartsWithASCII(str, FileTemplate::kSourceGenDir, true) ||
- StartsWithASCII(str, FileTemplate::kSourceOutDir, true))
- return true;
- }
-
*err = Err(originating, "File is not inside output directory.",
"The given file should be in the output directory. Normally you would "
"specify\n\"$target_out_dir/foo\" or "
« no previous file with comments | « tools/gn/filesystem_utils.h ('k') | tools/gn/filesystem_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698