| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 subninjas->insert(filename); | 62 subninjas->insert(filename); |
| 63 | 63 |
| 64 next_subninja = line_end; | 64 next_subninja = line_end; |
| 65 } | 65 } |
| 66 return *first_subninja_offset != std::string::npos; | 66 return *first_subninja_offset != std::string::npos; |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool FixupBuildNinja(const BuildSettings* build_settings, | 69 bool FixupBuildNinja(const BuildSettings* build_settings, |
| 70 const base::FilePath& buildfile) { | 70 const base::FilePath& buildfile) { |
| 71 std::string contents; | 71 std::string contents; |
| 72 if (!file_util::ReadFileToString(buildfile, &contents)) { | 72 if (!base::ReadFileToString(buildfile, &contents)) { |
| 73 Err(Location(), "Could not load " + FilePathToUTF8(buildfile)) | 73 Err(Location(), "Could not load " + FilePathToUTF8(buildfile)) |
| 74 .PrintToStdout(); | 74 .PrintToStdout(); |
| 75 return false; | 75 return false; |
| 76 } | 76 } |
| 77 | 77 |
| 78 std::set<std::string> subninjas; | 78 std::set<std::string> subninjas; |
| 79 size_t first_subninja_offset = 0; | 79 size_t first_subninja_offset = 0; |
| 80 if (!SimpleNinjaParse(contents, &subninjas, &first_subninja_offset)) { | 80 if (!SimpleNinjaParse(contents, &subninjas, &first_subninja_offset)) { |
| 81 Err(Location(), "Could not parse " + FilePathToUTF8(buildfile)) | 81 Err(Location(), "Could not parse " + FilePathToUTF8(buildfile)) |
| 82 .PrintToStdout(); | 82 .PrintToStdout(); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) + | 236 base::IntToString((end_gyp_time - begin_time).InMilliseconds()) + |
| 237 "ms)\n"; | 237 "ms)\n"; |
| 238 | 238 |
| 239 OutputString(stats); | 239 OutputString(stats); |
| 240 } | 240 } |
| 241 | 241 |
| 242 return 0; | 242 return 0; |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace commands | 245 } // namespace commands |
| OLD | NEW |