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

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

Issue 100573002: Move directory creation functions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years 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
« no previous file with comments | « tools/gn/gyp_target_writer.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "tools/gn/ninja_build_writer.h" 5 #include "tools/gn/ninja_build_writer.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 8
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 104
105 // static 105 // static
106 bool NinjaBuildWriter::RunAndWriteFile( 106 bool NinjaBuildWriter::RunAndWriteFile(
107 const BuildSettings* build_settings, 107 const BuildSettings* build_settings,
108 const std::vector<const Settings*>& all_settings, 108 const std::vector<const Settings*>& all_settings,
109 const std::vector<const Target*>& default_toolchain_targets) { 109 const std::vector<const Target*>& default_toolchain_targets) {
110 ScopedTrace trace(TraceItem::TRACE_FILE_WRITE, "build.ninja"); 110 ScopedTrace trace(TraceItem::TRACE_FILE_WRITE, "build.ninja");
111 111
112 base::FilePath ninja_file(build_settings->GetFullPath( 112 base::FilePath ninja_file(build_settings->GetFullPath(
113 SourceFile(build_settings->build_dir().value() + "build.ninja"))); 113 SourceFile(build_settings->build_dir().value() + "build.ninja")));
114 file_util::CreateDirectory(ninja_file.DirName()); 114 base::CreateDirectory(ninja_file.DirName());
115 115
116 std::ofstream file; 116 std::ofstream file;
117 file.open(FilePathToUTF8(ninja_file).c_str(), 117 file.open(FilePathToUTF8(ninja_file).c_str(),
118 std::ios_base::out | std::ios_base::binary); 118 std::ios_base::out | std::ios_base::binary);
119 if (file.fail()) 119 if (file.fail())
120 return false; 120 return false;
121 121
122 std::ofstream depfile; 122 std::ofstream depfile;
123 depfile.open((FilePathToUTF8(ninja_file) + ".d").c_str(), 123 depfile.open((FilePathToUTF8(ninja_file) + ".d").c_str(),
124 std::ios_base::out | std::ios_base::binary); 124 std::ios_base::out | std::ios_base::binary);
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 all_rules.append(" $\n "); 204 all_rules.append(" $\n ");
205 all_rules.append(target_file.value()); 205 all_rules.append(target_file.value());
206 } 206 }
207 207
208 if (!all_rules.empty()) { 208 if (!all_rules.empty()) {
209 out_ << "\nbuild all: phony " << all_rules << std::endl; 209 out_ << "\nbuild all: phony " << all_rules << std::endl;
210 out_ << "default all" << std::endl; 210 out_ << "default all" << std::endl;
211 } 211 }
212 } 212 }
213 213
OLDNEW
« no previous file with comments | « tools/gn/gyp_target_writer.cc ('k') | tools/gn/ninja_target_writer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698