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

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

Issue 115323009: Fix help and error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 6 years, 11 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/command_help.cc ('k') | tools/gn/function_exec_script.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/filesystem_utils.h" 5 #include "tools/gn/filesystem_utils.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 const Value& originating, 280 const Value& originating,
281 Err* err) { 281 Err* err) {
282 // The last char of the dir will be a slash. We don't care if the input ends 282 // The last char of the dir will be a slash. We don't care if the input ends
283 // in a slash or not, so just compare up until there. 283 // in a slash or not, so just compare up until there.
284 // 284 //
285 // This check will be wrong for all proper prefixes "e.g. "/output" will 285 // This check will be wrong for all proper prefixes "e.g. "/output" will
286 // match "/out" but we don't really care since this is just a sanity check. 286 // match "/out" but we don't really care since this is just a sanity check.
287 const std::string& dir_str = dir.value(); 287 const std::string& dir_str = dir.value();
288 if (str.compare(0, dir_str.length() - 1, dir_str, 0, dir_str.length() - 1) 288 if (str.compare(0, dir_str.length() - 1, dir_str, 0, dir_str.length() - 1)
289 != 0) { 289 != 0) {
290 *err = Err(originating, "File not inside output directory.", 290 *err = Err(originating, "File is not inside output directory.",
291 "The given file should be in the output directory. Normally you would " 291 "The given file should be in the output directory. Normally you would "
292 "specify\n\"$target_output_dir/foo\" or " 292 "specify\n\"$target_out_dir/foo\" or "
293 "\"$target_gen_dir/foo\". I interpreted this as\n\"" 293 "\"$target_gen_dir/foo\". I interpreted this as\n\""
294 + str + "\"."); 294 + str + "\".");
295 return false; 295 return false;
296 } 296 }
297 return true; 297 return true;
298 } 298 }
299 299
300 bool IsPathAbsolute(const base::StringPiece& path) { 300 bool IsPathAbsolute(const base::StringPiece& path) {
301 if (path.empty()) 301 if (path.empty())
302 return false; 302 return false;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
624 return GetGenDirForSourceDir(target->settings(), target->label().dir()); 624 return GetGenDirForSourceDir(target->settings(), target->label().dir());
625 } 625 }
626 626
627 SourceDir GetCurrentOutputDir(const Scope* scope) { 627 SourceDir GetCurrentOutputDir(const Scope* scope) {
628 return GetOutputDirForSourceDir(scope->settings(), scope->GetSourceDir()); 628 return GetOutputDirForSourceDir(scope->settings(), scope->GetSourceDir());
629 } 629 }
630 630
631 SourceDir GetCurrentGenDir(const Scope* scope) { 631 SourceDir GetCurrentGenDir(const Scope* scope) {
632 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir()); 632 return GetGenDirForSourceDir(scope->settings(), scope->GetSourceDir());
633 } 633 }
OLDNEW
« no previous file with comments | « tools/gn/command_help.cc ('k') | tools/gn/function_exec_script.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698