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

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

Issue 819223002: Make callers of CommandLine use it via the base:: namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years, 12 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/command_check.cc ('k') | tools/gn/command_gen.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 <algorithm> 5 #include <algorithm>
6 #include <set> 6 #include <set>
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "tools/gn/commands.h" 10 #include "tools/gn/commands.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 95
96 OutputString("\n"); 96 OutputString("\n");
97 if (print_children) { 97 if (print_children) {
98 RecursivePrintDeps(cur_dep, default_toolchain, seen_targets, 98 RecursivePrintDeps(cur_dep, default_toolchain, seen_targets,
99 indent_level + 1); 99 indent_level + 1);
100 } 100 }
101 } 101 }
102 } 102 }
103 103
104 void PrintDeps(const Target* target, bool display_header) { 104 void PrintDeps(const Target* target, bool display_header) {
105 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); 105 const base::CommandLine* cmdline = base::CommandLine::ForCurrentProcess();
106 Label toolchain_label = target->label().GetToolchainLabel(); 106 Label toolchain_label = target->label().GetToolchainLabel();
107 107
108 // Tree mode is separate. 108 // Tree mode is separate.
109 if (cmdline->HasSwitch("tree")) { 109 if (cmdline->HasSwitch("tree")) {
110 if (display_header) 110 if (display_header)
111 OutputString("\nDependency tree:\n"); 111 OutputString("\nDependency tree:\n");
112 112
113 if (cmdline->HasSwitch("all")) { 113 if (cmdline->HasSwitch("all")) {
114 // Show all tree deps with no eliding. 114 // Show all tree deps with no eliding.
115 RecursivePrintDeps(target, toolchain_label, NULL, 1); 115 RecursivePrintDeps(target, toolchain_label, NULL, 1);
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 out << " " << FormatSourceDir(dir) << "\n"; 400 out << " " << FormatSourceDir(dir) << "\n";
401 } 401 }
402 }; 402 };
403 403
404 // Writes a given config value type to the string, optionally with attribution. 404 // Writes a given config value type to the string, optionally with attribution.
405 // This should match RecursiveTargetConfigToStream in the order it traverses. 405 // This should match RecursiveTargetConfigToStream in the order it traverses.
406 template<typename T> void OutputRecursiveTargetConfig( 406 template<typename T> void OutputRecursiveTargetConfig(
407 const Target* target, 407 const Target* target,
408 const char* header_name, 408 const char* header_name,
409 const std::vector<T>& (ConfigValues::* getter)() const) { 409 const std::vector<T>& (ConfigValues::* getter)() const) {
410 bool display_blame = CommandLine::ForCurrentProcess()->HasSwitch("blame"); 410 bool display_blame =
411 base::CommandLine::ForCurrentProcess()->HasSwitch("blame");
411 412
412 DescValueWriter<T> writer; 413 DescValueWriter<T> writer;
413 std::ostringstream out; 414 std::ostringstream out;
414 415
415 for (ConfigValuesIterator iter(target); !iter.done(); iter.Next()) { 416 for (ConfigValuesIterator iter(target); !iter.done(); iter.Next()) {
416 if ((iter.cur().*getter)().empty()) 417 if ((iter.cur().*getter)().empty())
417 continue; 418 continue;
418 419
419 // Optional blame sub-head. 420 // Optional blame sub-head.
420 if (display_blame) { 421 if (display_blame) {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 // so always display them, even for groups and such. 700 // so always display them, even for groups and such.
700 PrintLibs(target, true); 701 PrintLibs(target, true);
701 PrintLibDirs(target, true); 702 PrintLibDirs(target, true);
702 703
703 PrintDeps(target, true); 704 PrintDeps(target, true);
704 705
705 return 0; 706 return 0;
706 } 707 }
707 708
708 } // namespace commands 709 } // namespace commands
OLDNEW
« no previous file with comments | « tools/gn/command_check.cc ('k') | tools/gn/command_gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698