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

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

Issue 318383003: Improve error messages and reporting in GN (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/builder_unittest.cc ('k') | tools/gn/loader.h » ('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/input_file_manager.h" 5 #include "tools/gn/input_file_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "tools/gn/filesystem_utils.h" 9 #include "tools/gn/filesystem_utils.h"
10 #include "tools/gn/parser.h" 10 #include "tools/gn/parser.h"
(...skipping 28 matching lines...) Expand all
39 // Read. 39 // Read.
40 base::FilePath primary_path = build_settings->GetFullPath(name); 40 base::FilePath primary_path = build_settings->GetFullPath(name);
41 ScopedTrace load_trace(TraceItem::TRACE_FILE_LOAD, name.value()); 41 ScopedTrace load_trace(TraceItem::TRACE_FILE_LOAD, name.value());
42 if (!file->Load(primary_path)) { 42 if (!file->Load(primary_path)) {
43 if (!build_settings->secondary_source_path().empty()) { 43 if (!build_settings->secondary_source_path().empty()) {
44 // Fall back to secondary source tree. 44 // Fall back to secondary source tree.
45 base::FilePath secondary_path = 45 base::FilePath secondary_path =
46 build_settings->GetFullPathSecondary(name); 46 build_settings->GetFullPathSecondary(name);
47 if (!file->Load(secondary_path)) { 47 if (!file->Load(secondary_path)) {
48 *err = Err(origin, "Can't load input file.", 48 *err = Err(origin, "Can't load input file.",
49 "Unable to load either \n" + 49 "Unable to load:\n " +
50 FilePathToUTF8(primary_path) + " or \n" + 50 FilePathToUTF8(primary_path) + "\n"
51 "I also checked in the secondary tree for:\n " +
51 FilePathToUTF8(secondary_path)); 52 FilePathToUTF8(secondary_path));
52 return false; 53 return false;
53 } 54 }
54 } else { 55 } else {
55 *err = Err(origin, 56 *err = Err(origin,
56 "Unable to load \"" + FilePathToUTF8(primary_path) + "\"."); 57 "Unable to load \"" + FilePathToUTF8(primary_path) + "\".");
57 return false; 58 return false;
58 } 59 }
59 } 60 }
60 load_trace.Done(); 61 load_trace.Done();
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 309
309 // Run pending invocations. Theoretically we could schedule each of these 310 // Run pending invocations. Theoretically we could schedule each of these
310 // separately to get some parallelism. But normally there will only be one 311 // separately to get some parallelism. But normally there will only be one
311 // item in the list, so that's extra overhead and complexity for no gain. 312 // item in the list, so that's extra overhead and complexity for no gain.
312 if (success) { 313 if (success) {
313 for (size_t i = 0; i < callbacks.size(); i++) 314 for (size_t i = 0; i < callbacks.size(); i++)
314 callbacks[i].Run(unowned_root); 315 callbacks[i].Run(unowned_root);
315 } 316 }
316 return success; 317 return success;
317 } 318 }
OLDNEW
« no previous file with comments | « tools/gn/builder_unittest.cc ('k') | tools/gn/loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698