| OLD | NEW |
| 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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 | 461 |
| 462 Value RunImport(Scope* scope, | 462 Value RunImport(Scope* scope, |
| 463 const FunctionCallNode* function, | 463 const FunctionCallNode* function, |
| 464 const std::vector<Value>& args, | 464 const std::vector<Value>& args, |
| 465 Err* err) { | 465 Err* err) { |
| 466 if (!EnsureSingleStringArg(function, args, err)) | 466 if (!EnsureSingleStringArg(function, args, err)) |
| 467 return Value(); | 467 return Value(); |
| 468 | 468 |
| 469 const SourceDir& input_dir = scope->GetSourceDir(); | 469 const SourceDir& input_dir = scope->GetSourceDir(); |
| 470 SourceFile import_file = | 470 SourceFile import_file = |
| 471 input_dir.ResolveRelativeFile(args[0].string_value()); | 471 input_dir.ResolveRelativeFile(args[0].string_value(), |
| 472 scope->settings()->build_settings()->root_path()); |
| 472 scope->settings()->import_manager().DoImport(import_file, function, | 473 scope->settings()->import_manager().DoImport(import_file, function, |
| 473 scope, err); | 474 scope, err); |
| 474 return Value(); | 475 return Value(); |
| 475 } | 476 } |
| 476 | 477 |
| 477 // set_sources_assignment_filter ----------------------------------------------- | 478 // set_sources_assignment_filter ----------------------------------------------- |
| 478 | 479 |
| 479 const char kSetSourcesAssignmentFilter[] = "set_sources_assignment_filter"; | 480 const char kSetSourcesAssignmentFilter[] = "set_sources_assignment_filter"; |
| 480 const char kSetSourcesAssignmentFilter_HelpShort[] = | 481 const char kSetSourcesAssignmentFilter_HelpShort[] = |
| 481 "set_sources_assignment_filter: Set a pattern to filter source files."; | 482 "set_sources_assignment_filter: Set a pattern to filter source files."; |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 781 return Value(); | 782 return Value(); |
| 782 return result; | 783 return result; |
| 783 } | 784 } |
| 784 | 785 |
| 785 // Otherwise it's a no-block function. | 786 // Otherwise it's a no-block function. |
| 786 return found_function->second.no_block_runner(scope, function, | 787 return found_function->second.no_block_runner(scope, function, |
| 787 args.list_value(), err); | 788 args.list_value(), err); |
| 788 } | 789 } |
| 789 | 790 |
| 790 } // namespace functions | 791 } // namespace functions |
| OLD | NEW |