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

Unified Diff: tools/gn/filesystem_utils.h

Issue 165823003: GN: Change gen command syntax, support relative dirs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments fixes Created 6 years, 10 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/commands.cc ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/filesystem_utils.h
diff --git a/tools/gn/filesystem_utils.h b/tools/gn/filesystem_utils.h
index 152851d971cc4a1e167254eae66ae38a76f9842b..ba0863563a8aa2492fd658ec0ac67e49c89f2d45 100644
--- a/tools/gn/filesystem_utils.h
+++ b/tools/gn/filesystem_utils.h
@@ -145,6 +145,17 @@ std::string RebaseSourceAbsolutePath(const std::string& input,
// a "." so this remains valid.
std::string DirectoryWithNoLastSlash(const SourceDir& dir);
+// Returns the "best" SourceDir representing the given path. If it's inside the
+// given source_root, a source-relative directory will be returned (e.g.
+// "//foo/bar.cc". If it's outside of the source root, a system-absolute
+// directory will be returned.
+SourceDir SourceDirForPath(const base::FilePath& source_root,
+ const base::FilePath& path);
+
+// Like SourceDirForPath but returns the SourceDir representing the current
+// directory.
+SourceDir SourceDirForCurrentDirectory(const base::FilePath& source_root);
+
// -----------------------------------------------------------------------------
// These functions return the various flavors of output and gen directories.
« no previous file with comments | « tools/gn/commands.cc ('k') | tools/gn/filesystem_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698