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

Unified Diff: tools/gn/setup.h

Issue 21114002: Add initial prototype for the GN meta-buildsystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add owners and readme Created 7 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/settings.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/setup.h
diff --git a/tools/gn/setup.h b/tools/gn/setup.h
new file mode 100644
index 0000000000000000000000000000000000000000..e698ac54f2610bab8022672df4a8cf9eb3183738
--- /dev/null
+++ b/tools/gn/setup.h
@@ -0,0 +1,69 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TOOLS_GN_SETUP_H_
+#define TOOLS_GN_SETUP_H_
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/files/file_path.h"
+#include "base/memory/scoped_ptr.h"
+#include "tools/gn/build_settings.h"
+#include "tools/gn/scheduler.h"
+#include "tools/gn/scope.h"
+#include "tools/gn/settings.h"
+#include "tools/gn/token.h"
+#include "tools/gn/toolchain.h"
+
+class CommandLine;
+class InputFile;
+class ParseNode;
+
+// Helper class to setup the build settings and environment for the various
+// commands to run.
+class Setup {
+ public:
+ Setup();
+ ~Setup();
+
+ // Configures the build for the current command line. On success returns
+ // true. On failure, prints the error and returns false.
+ bool DoSetup();
+
+ // Runs the load, returning true on success. On failure, prints the error
+ // and returns false.
+ bool Run();
+
+ BuildSettings& build_settings() { return build_settings_; }
+ Scheduler& scheduler() { return scheduler_; }
+
+ private:
+ // Fills the root directory into the settings. Returns true on success.
+ bool FillSourceDir(const CommandLine& cmdline);
+
+ // Run config file.
+ bool RunConfigFile();
+
+ bool FillOtherConfig(const CommandLine& cmdline);
+
+ BuildSettings build_settings_;
+ Scheduler scheduler_;
+
+ // State for invoking the dotfile.
+ // TODO(brettw) this seems a bit excessive, maybe we can get this down
+ // somehow?
+ base::FilePath dotfile_name_;
+ scoped_ptr<InputFile> dotfile_input_file_;
+ std::vector<Token> dotfile_tokens_;
+ scoped_ptr<ParseNode> dotfile_root_;
+ BuildSettings dotfile_build_settings_;
+ Toolchain dotfile_toolchain_;
+ Settings dotfile_settings_;
+ Scope dotfile_scope_;
+
+ DISALLOW_COPY_AND_ASSIGN(Setup);
+};
+
+#endif // TOOLS_GN_SETUP_H_
« no previous file with comments | « tools/gn/settings.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698