| 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 #ifndef TOOLS_GN_SETUP_H_ | 5 #ifndef TOOLS_GN_SETUP_H_ |
| 6 #define TOOLS_GN_SETUP_H_ | 6 #define TOOLS_GN_SETUP_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 public: | 91 public: |
| 92 Setup(); | 92 Setup(); |
| 93 virtual ~Setup(); | 93 virtual ~Setup(); |
| 94 | 94 |
| 95 // Configures the build for the current command line. On success returns | 95 // Configures the build for the current command line. On success returns |
| 96 // true. On failure, prints the error and returns false. | 96 // true. On failure, prints the error and returns false. |
| 97 // | 97 // |
| 98 // The parameter is the string the user specified for the build directory. We | 98 // The parameter is the string the user specified for the build directory. We |
| 99 // will try to interpret this as a SourceDir if possible, and will fail if is | 99 // will try to interpret this as a SourceDir if possible, and will fail if is |
| 100 // is malformed. | 100 // is malformed. |
| 101 bool DoSetup(const std::string& build_dir); | 101 // |
| 102 // With force_create = false, setup will fail if the build directory doesn't |
| 103 // alreay exist with an args file in it. With force_create set to true, the |
| 104 // directory will be created if necessary. Commands explicitly doing |
| 105 // generation should set this to true to create it, but querying commands |
| 106 // should set it to false to prevent creating oddly-named directories in case |
| 107 // the user omits the build directory argument (which is easy to do). |
| 108 bool DoSetup(const std::string& build_dir, bool force_create); |
| 102 | 109 |
| 103 // Runs the load, returning true on success. On failure, prints the error | 110 // Runs the load, returning true on success. On failure, prints the error |
| 104 // and returns false. This includes both RunPreMessageLoop() and | 111 // and returns false. This includes both RunPreMessageLoop() and |
| 105 // RunPostMessageLoop(). | 112 // RunPostMessageLoop(). |
| 106 bool Run(); | 113 bool Run(); |
| 107 | 114 |
| 108 Scheduler& scheduler() { return scheduler_; } | 115 Scheduler& scheduler() { return scheduler_; } |
| 109 | 116 |
| 110 virtual Scheduler* GetScheduler() OVERRIDE; | 117 virtual Scheduler* GetScheduler() OVERRIDE; |
| 111 | 118 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 132 bool FillArgsFromArgsInputFile(); | 139 bool FillArgsFromArgsInputFile(); |
| 133 | 140 |
| 134 // Writes the build arguments to the build arg file. | 141 // Writes the build arguments to the build arg file. |
| 135 bool SaveArgsToFile(); | 142 bool SaveArgsToFile(); |
| 136 | 143 |
| 137 // Fills the root directory into the settings. Returns true on success. | 144 // Fills the root directory into the settings. Returns true on success. |
| 138 bool FillSourceDir(const base::CommandLine& cmdline); | 145 bool FillSourceDir(const base::CommandLine& cmdline); |
| 139 | 146 |
| 140 // Fills the build directory given the value the user has specified. | 147 // Fills the build directory given the value the user has specified. |
| 141 // Must happen after FillSourceDir so we can resolve source-relative | 148 // Must happen after FillSourceDir so we can resolve source-relative |
| 142 // paths. | 149 // paths. If require_exists is false, it will fail if the dir doesn't exist. |
| 143 bool FillBuildDir(const std::string& build_dir); | 150 bool FillBuildDir(const std::string& build_dir, bool require_exists); |
| 144 | 151 |
| 145 // Fills the python path portion of the command line. On failure, sets | 152 // Fills the python path portion of the command line. On failure, sets |
| 146 // it to just "python". | 153 // it to just "python". |
| 147 void FillPythonPath(); | 154 void FillPythonPath(); |
| 148 | 155 |
| 149 // Run config file. | 156 // Run config file. |
| 150 bool RunConfigFile(); | 157 bool RunConfigFile(); |
| 151 | 158 |
| 152 bool FillOtherConfig(const base::CommandLine& cmdline); | 159 bool FillOtherConfig(const base::CommandLine& cmdline); |
| 153 | 160 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 void RunPreMessageLoop(); | 209 void RunPreMessageLoop(); |
| 203 bool RunPostMessageLoop(); | 210 bool RunPostMessageLoop(); |
| 204 | 211 |
| 205 virtual Scheduler* GetScheduler() OVERRIDE; | 212 virtual Scheduler* GetScheduler() OVERRIDE; |
| 206 | 213 |
| 207 private: | 214 private: |
| 208 Scheduler* scheduler_; | 215 Scheduler* scheduler_; |
| 209 }; | 216 }; |
| 210 | 217 |
| 211 #endif // TOOLS_GN_SETUP_H_ | 218 #endif // TOOLS_GN_SETUP_H_ |
| OLD | NEW |