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

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

Issue 1155713006: GN: Make file/dir resolving return errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « tools/gn/function_write_file.cc ('k') | tools/gn/label.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/functions.h" 5 #include "tools/gn/functions.h"
6 6
7 #include <iostream> 7 #include <iostream>
8 8
9 #include "base/environment.h" 9 #include "base/environment.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
484 484
485 Value RunImport(Scope* scope, 485 Value RunImport(Scope* scope,
486 const FunctionCallNode* function, 486 const FunctionCallNode* function,
487 const std::vector<Value>& args, 487 const std::vector<Value>& args,
488 Err* err) { 488 Err* err) {
489 if (!EnsureSingleStringArg(function, args, err)) 489 if (!EnsureSingleStringArg(function, args, err))
490 return Value(); 490 return Value();
491 491
492 const SourceDir& input_dir = scope->GetSourceDir(); 492 const SourceDir& input_dir = scope->GetSourceDir();
493 SourceFile import_file = 493 SourceFile import_file =
494 input_dir.ResolveRelativeFile(args[0].string_value(), 494 input_dir.ResolveRelativeFile(args[0], err,
495 scope->settings()->build_settings()->root_path_utf8()); 495 scope->settings()->build_settings()->root_path_utf8());
496 scope->settings()->import_manager().DoImport(import_file, function, 496 if (!err->has_error()) {
497 scope, err); 497 scope->settings()->import_manager().DoImport(import_file, function,
498 scope, err);
499 }
498 return Value(); 500 return Value();
499 } 501 }
500 502
501 // set_sources_assignment_filter ----------------------------------------------- 503 // set_sources_assignment_filter -----------------------------------------------
502 504
503 const char kSetSourcesAssignmentFilter[] = "set_sources_assignment_filter"; 505 const char kSetSourcesAssignmentFilter[] = "set_sources_assignment_filter";
504 const char kSetSourcesAssignmentFilter_HelpShort[] = 506 const char kSetSourcesAssignmentFilter_HelpShort[] =
505 "set_sources_assignment_filter: Set a pattern to filter source files."; 507 "set_sources_assignment_filter: Set a pattern to filter source files.";
506 const char kSetSourcesAssignmentFilter_Help[] = 508 const char kSetSourcesAssignmentFilter_Help[] =
507 "set_sources_assignment_filter: Set a pattern to filter source files.\n" 509 "set_sources_assignment_filter: Set a pattern to filter source files.\n"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 } 817 }
816 818
817 // Otherwise it's a no-block function. 819 // Otherwise it's a no-block function.
818 if (!VerifyNoBlockForFunctionCall(function, block, err)) 820 if (!VerifyNoBlockForFunctionCall(function, block, err))
819 return Value(); 821 return Value();
820 return found_function->second.no_block_runner(scope, function, 822 return found_function->second.no_block_runner(scope, function,
821 args.list_value(), err); 823 args.list_value(), err);
822 } 824 }
823 825
824 } // namespace functions 826 } // namespace functions
OLDNEW
« no previous file with comments | « tools/gn/function_write_file.cc ('k') | tools/gn/label.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698