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 "base/atomicops.h" | 5 #include "base/atomicops.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/timer/elapsed_timer.h" | 9 #include "base/timer/elapsed_timer.h" |
10 #include "tools/gn/build_settings.h" | 10 #include "tools/gn/build_settings.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 " Generates ninja files from the current tree and puts them in the given\n" | 82 " Generates ninja files from the current tree and puts them in the given\n" |
83 " output directory.\n" | 83 " output directory.\n" |
84 "\n" | 84 "\n" |
85 " The output directory can be a source-repo-absolute path name such as:\n" | 85 " The output directory can be a source-repo-absolute path name such as:\n" |
86 " //out/foo\n" | 86 " //out/foo\n" |
87 " Or it can be a directory relative to the current directory such as:\n" | 87 " Or it can be a directory relative to the current directory such as:\n" |
88 " out/foo\n" | 88 " out/foo\n" |
89 "\n" | 89 "\n" |
90 " See \"gn help\" for the common command-line switches.\n"; | 90 " See \"gn help\" for the common command-line switches.\n"; |
91 | 91 |
92 // Note: partially duplicated in command_gyp.cc. | |
93 int RunGen(const std::vector<std::string>& args) { | 92 int RunGen(const std::vector<std::string>& args) { |
94 base::ElapsedTimer timer; | 93 base::ElapsedTimer timer; |
95 | 94 |
96 if (args.size() != 1) { | 95 if (args.size() != 1) { |
97 Err(Location(), "Need exactly one build directory to generate.", | 96 Err(Location(), "Need exactly one build directory to generate.", |
98 "I expected something more like \"gn gen out/foo\"\n" | 97 "I expected something more like \"gn gen out/foo\"\n" |
99 "You can also see \"gn help gen\".").PrintToStdout(); | 98 "You can also see \"gn help gen\".").PrintToStdout(); |
100 return 1; | 99 return 1; |
101 } | 100 } |
102 | 101 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 setup->scheduler().input_file_manager()->GetInputFileCount()) + | 135 setup->scheduler().input_file_manager()->GetInputFileCount()) + |
137 " files in " + | 136 " files in " + |
138 base::IntToString(elapsed_time.InMilliseconds()) + "ms\n"; | 137 base::IntToString(elapsed_time.InMilliseconds()) + "ms\n"; |
139 OutputString(stats); | 138 OutputString(stats); |
140 } | 139 } |
141 | 140 |
142 return 0; | 141 return 0; |
143 } | 142 } |
144 | 143 |
145 } // namespace commands | 144 } // namespace commands |
OLD | NEW |