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/import_manager.h" | 5 #include "tools/gn/import_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "tools/gn/parse_tree.h" | 10 #include "tools/gn/parse_tree.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 Scope::MergeOptions options; | 88 Scope::MergeOptions options; |
89 options.skip_private_vars = true; | 89 options.skip_private_vars = true; |
90 options.mark_dest_used = true; // Don't require all imported values be used. | 90 options.mark_dest_used = true; // Don't require all imported values be used. |
91 return imported_scope->NonRecursiveMergeTo(scope, options, node_for_err, | 91 return imported_scope->NonRecursiveMergeTo(scope, options, node_for_err, |
92 "import", err); | 92 "import", err); |
93 } | 93 } |
| 94 |
| 95 std::vector<SourceFile> ImportManager::GetImportedFiles() const { |
| 96 std::vector<SourceFile> imported_files; |
| 97 imported_files.resize(imports_.size()); |
| 98 std::transform(imports_.begin(), imports_.end(), imported_files.begin(), |
| 99 [](const ImportMap::value_type& val) { return val.first; }); |
| 100 return imported_files; |
| 101 } |
OLD | NEW |