Chromium Code Reviews| 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 <fstream> | 5 #include <fstream> |
| 6 | 6 |
| 7 #include "base/atomicops.h" | 7 #include "base/atomicops.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 Err(Location(), "GYP execution failed.", output).PrintToStdout(); | 143 Err(Location(), "GYP execution failed.", output).PrintToStdout(); |
| 144 return false; | 144 return false; |
| 145 } | 145 } |
| 146 return true; | 146 return true; |
| 147 } | 147 } |
| 148 | 148 |
| 149 } // namespace | 149 } // namespace |
| 150 | 150 |
| 151 const char kGyp[] = "gyp"; | 151 const char kGyp[] = "gyp"; |
| 152 const char kGyp_HelpShort[] = | 152 const char kGyp_HelpShort[] = |
| 153 "gyp: Run gyp and then GN."; | 153 "gyp: Run GYP and then GN."; |
| 154 const char kGyp_Help[] = | 154 const char kGyp_Help[] = |
| 155 "TODO(brettw) write this.\n"; | 155 "gyp: Run GYP and then GN.\n" |
| 156 "\n" | |
| 157 " Generate a hybird GYP/GN build where some targets are generated by\n" | |
|
Nico
2013/08/29 22:41:28
typo "hybird"
(in vim, you can `:set spell` to ha
| |
| 158 " each of the tools. As long as target names and locations match between\n" | |
| 159 " the two tools, they can depend on each other.\n" | |
| 160 "\n" | |
| 161 " When GN is run in this mode, it will not write out any targets\n" | |
| 162 " annotated with \"external = true\". Otherwise, GYP targets with the\n" | |
| 163 " same name and location will be overwritten.\n" | |
| 164 "\n" | |
| 165 " References to the GN ninja files will be inserted into the\n" | |
| 166 " GYP-generated build.ninja file.\n" | |
| 167 "\n" | |
| 168 "Option:\n" | |
| 169 " --no-gyp\n" | |
| 170 " Don't actually run GYP or modify build.ninja. This is used when\n" | |
| 171 " working on the GN build when it is known that no GYP files have\n" | |
| 172 " changed and you want it to run faster.\n"; | |
| 156 | 173 |
| 157 // Note: partially duplicated from command_gen.cc. | 174 // Note: partially duplicated from command_gen.cc. |
| 158 int RunGyp(const std::vector<std::string>& args) { | 175 int RunGyp(const std::vector<std::string>& args) { |
| 159 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); | 176 const CommandLine* cmdline = CommandLine::ForCurrentProcess(); |
| 160 bool no_gyp = cmdline->HasSwitch(kSwitchNoGyp); | 177 bool no_gyp = cmdline->HasSwitch(kSwitchNoGyp); |
| 161 | 178 |
| 162 // Deliberately leaked to avoid expensive process teardown. | 179 // Deliberately leaked to avoid expensive process teardown. |
| 163 Setup* setup = new Setup; | 180 Setup* setup = new Setup; |
| 164 if (!setup->DoSetup()) | 181 if (!setup->DoSetup()) |
| 165 return 1; | 182 return 1; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 219 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) + | 236 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) + |
| 220 "ms)\n"; | 237 "ms)\n"; |
| 221 | 238 |
| 222 OutputString(stats); | 239 OutputString(stats); |
| 223 } | 240 } |
| 224 | 241 |
| 225 return 0; | 242 return 0; |
| 226 } | 243 } |
| 227 | 244 |
| 228 } // namespace commands | 245 } // namespace commands |
| OLD | NEW |