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

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

Issue 1982463002: [Mac/GN] Treat create_bundle as a leaf for `gn desc runtime_deps`. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Return as dir Created 4 years, 7 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/runtime_deps.h" 5 #include "tools/gn/runtime_deps.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <sstream> 9 #include <sstream>
10 10
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 if (is_target_data_dep && 97 if (is_target_data_dep &&
98 (target->output_type() == Target::ACTION || 98 (target->output_type() == Target::ACTION ||
99 target->output_type() == Target::ACTION_FOREACH || 99 target->output_type() == Target::ACTION_FOREACH ||
100 target->output_type() == Target::COPY_FILES)) { 100 target->output_type() == Target::COPY_FILES)) {
101 std::vector<SourceFile> outputs; 101 std::vector<SourceFile> outputs;
102 target->action_values().GetOutputsAsSourceFiles(target, &outputs); 102 target->action_values().GetOutputsAsSourceFiles(target, &outputs);
103 for (const auto& output_file : outputs) 103 for (const auto& output_file : outputs)
104 AddIfNew(output_file.value(), target, deps, found_files); 104 AddIfNew(output_file.value(), target, deps, found_files);
105 } 105 }
106 106
107 // Do not recurse into bundle targets. A bundle's dependencies should be
108 // copied into the bundle itself for run-time access.
109 if (target->output_type() == Target::CREATE_BUNDLE) {
110 SourceDir bundle_root_dir =
111 target->bundle_data().GetBundleRootDirOutputAsDir(target->settings());
112 AddIfNew(bundle_root_dir.value(), target, deps, found_files);
113 return;
114 }
115
107 // Non-data dependencies (both public and private). 116 // Non-data dependencies (both public and private).
108 for (const auto& dep_pair : target->GetDeps(Target::DEPS_LINKED)) { 117 for (const auto& dep_pair : target->GetDeps(Target::DEPS_LINKED)) {
109 if (dep_pair.ptr->output_type() == Target::EXECUTABLE) 118 if (dep_pair.ptr->output_type() == Target::EXECUTABLE)
110 continue; // Skip executables that aren't data deps. 119 continue; // Skip executables that aren't data deps.
111 RecursiveCollectRuntimeDeps(dep_pair.ptr, false, 120 RecursiveCollectRuntimeDeps(dep_pair.ptr, false,
112 deps, seen_targets, found_files); 121 deps, seen_targets, found_files);
113 } 122 }
114 123
115 // Data dependencies. 124 // Data dependencies.
116 for (const auto& dep_pair : target->data_deps()) { 125 for (const auto& dep_pair : target->data_deps()) {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 294
286 for (const auto& entry : files_to_write) { 295 for (const auto& entry : files_to_write) {
287 // Currently this writes all runtime deps files sequentially. We generally 296 // Currently this writes all runtime deps files sequentially. We generally
288 // expect few of these. We can run this on the worker pool if it looks 297 // expect few of these. We can run this on the worker pool if it looks
289 // like it's talking a long time. 298 // like it's talking a long time.
290 if (!WriteRuntimeDepsFile(entry.first, entry.second, err)) 299 if (!WriteRuntimeDepsFile(entry.first, entry.second, err))
291 return false; 300 return false;
292 } 301 }
293 return true; 302 return true;
294 } 303 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698