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

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

Issue 216903004: Add optional public header checking to GN build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "tools/gn/commands.h"
6 #include "tools/gn/setup.h"
7 #include "tools/gn/standard_out.h"
8
9 namespace commands {
10
11 const char kCheck[] = "check";
12 const char kCheck_HelpShort[] =
13 "check: Check header dependencies.";
14 const char kCheck_Help[] =
15 "gn check: Check header dependencies.\n"
16 "\n"
17 " \"gn check\" is the same thing as \"gn gen\" with the \"--check\" flag\n"
18 " except that this command does not write out any build files. It's\n"
19 " intended to be an easy way to manually trigger include file checking.\n"
20 "\n"
21 " See \"gn help\" for the common command-line switches.\n";
22
23 // Note: partially duplicated in command_gyp.cc.
24 int RunCheck(const std::vector<std::string>& args) {
25 // Deliberately leaked to avoid expensive process teardown.
26 Setup* setup = new Setup();
27 // TODO(brettw) bug 343726: Use a temporary directory instead of this
28 // default one to avoid messing up any build that's in there.
29 if (!setup->DoSetup("//out/Default"))
scottmg 2014/04/05 00:40:07 //out/Check instead?
brettw 2014/04/07 05:08:19 I'm currently using this for all the "temporary" g
30 return 1;
31 setup->set_check_public_headers(true);
32
33 if (!setup->Run())
34 return 1;
35
36 OutputString("Header dependency check OK\n", DECORATION_GREEN);
37 return 0;
38 }
39
40 } // namespace commands
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698