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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/commands.cc ('k') | tools/gn/filesystem_utils.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 #ifndef TOOLS_GN_FILESYSTEM_UTILS_H_ 5 #ifndef TOOLS_GN_FILESYSTEM_UTILS_H_
6 #define TOOLS_GN_FILESYSTEM_UTILS_H_ 6 #define TOOLS_GN_FILESYSTEM_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 std::string RebaseSourceAbsolutePath(const std::string& input, 138 std::string RebaseSourceAbsolutePath(const std::string& input,
139 const SourceDir& dest_dir); 139 const SourceDir& dest_dir);
140 140
141 // Returns the given directory with no terminating slash at the end, such that 141 // Returns the given directory with no terminating slash at the end, such that
142 // appending a slash and more stuff will produce a valid path. 142 // appending a slash and more stuff will produce a valid path.
143 // 143 //
144 // If the directory refers to either the source or system root, we'll append 144 // If the directory refers to either the source or system root, we'll append
145 // a "." so this remains valid. 145 // a "." so this remains valid.
146 std::string DirectoryWithNoLastSlash(const SourceDir& dir); 146 std::string DirectoryWithNoLastSlash(const SourceDir& dir);
147 147
148 // Returns the "best" SourceDir representing the given path. If it's inside the
149 // given source_root, a source-relative directory will be returned (e.g.
150 // "//foo/bar.cc". If it's outside of the source root, a system-absolute
151 // directory will be returned.
152 SourceDir SourceDirForPath(const base::FilePath& source_root,
153 const base::FilePath& path);
154
155 // Like SourceDirForPath but returns the SourceDir representing the current
156 // directory.
157 SourceDir SourceDirForCurrentDirectory(const base::FilePath& source_root);
158
148 // ----------------------------------------------------------------------------- 159 // -----------------------------------------------------------------------------
149 160
150 // These functions return the various flavors of output and gen directories. 161 // These functions return the various flavors of output and gen directories.
151 SourceDir GetToolchainOutputDir(const Settings* settings); 162 SourceDir GetToolchainOutputDir(const Settings* settings);
152 SourceDir GetToolchainGenDir(const Settings* settings); 163 SourceDir GetToolchainGenDir(const Settings* settings);
153 SourceDir GetOutputDirForSourceDir(const Settings* settings, 164 SourceDir GetOutputDirForSourceDir(const Settings* settings,
154 const SourceDir& source_dir); 165 const SourceDir& source_dir);
155 SourceDir GetGenDirForSourceDir(const Settings* settings, 166 SourceDir GetGenDirForSourceDir(const Settings* settings,
156 const SourceDir& source_dir); 167 const SourceDir& source_dir);
157 SourceDir GetTargetOutputDir(const Target* target); 168 SourceDir GetTargetOutputDir(const Target* target);
158 SourceDir GetTargetGenDir(const Target* target); 169 SourceDir GetTargetGenDir(const Target* target);
159 SourceDir GetCurrentOutputDir(const Scope* scope); 170 SourceDir GetCurrentOutputDir(const Scope* scope);
160 SourceDir GetCurrentGenDir(const Scope* scope); 171 SourceDir GetCurrentGenDir(const Scope* scope);
161 172
162 #endif // TOOLS_GN_FILESYSTEM_UTILS_H_ 173 #endif // TOOLS_GN_FILESYSTEM_UTILS_H_
OLDNEW
« 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