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

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

Issue 1155303008: Allow directories for GN data lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@path
Patch Set: add dir test Created 5 years, 6 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
« no previous file with comments | « tools/gn/output_file.h ('k') | tools/gn/runtime_deps.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 2014 The Chromium Authors. All rights reserved. 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 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/output_file.h" 5 #include "tools/gn/output_file.h"
6 6
7 #include "tools/gn/filesystem_utils.h" 7 #include "tools/gn/filesystem_utils.h"
8 #include "tools/gn/source_file.h" 8 #include "tools/gn/source_file.h"
9 9
10 OutputFile::OutputFile() : value_() { 10 OutputFile::OutputFile() : value_() {
11 } 11 }
12 12
13 OutputFile::OutputFile(const base::StringPiece& str) 13 OutputFile::OutputFile(std::string&& v)
14 : value_(str.data(), str.size()) { 14 : value_(v) {
15 }
16
17 OutputFile::OutputFile(const std::string& v)
18 : value_(v) {
15 } 19 }
16 20
17 OutputFile::OutputFile(const BuildSettings* build_settings, 21 OutputFile::OutputFile(const BuildSettings* build_settings,
18 const SourceFile& source_file) 22 const SourceFile& source_file)
19 : value_(RebasePath(source_file.value(), 23 : value_(RebasePath(source_file.value(),
20 build_settings->build_dir(), 24 build_settings->build_dir(),
21 build_settings->root_path_utf8())) { 25 build_settings->root_path_utf8())) {
22 } 26 }
23 27
24 OutputFile::~OutputFile() { 28 OutputFile::~OutputFile() {
(...skipping 13 matching lines...) Expand all
38 if (!value_.empty()) { 42 if (!value_.empty()) {
39 // Empty means the root build dir. Otherwise, we expect it to end in a 43 // Empty means the root build dir. Otherwise, we expect it to end in a
40 // slash. 44 // slash.
41 DCHECK(value_[value_.size() - 1] == '/'); 45 DCHECK(value_[value_.size() - 1] == '/');
42 } 46 }
43 std::string path = build_settings->build_dir().value(); 47 std::string path = build_settings->build_dir().value();
44 path.append(value_); 48 path.append(value_);
45 NormalizePath(&path); 49 NormalizePath(&path);
46 return SourceDir(path); 50 return SourceDir(path);
47 } 51 }
OLDNEW
« no previous file with comments | « tools/gn/output_file.h ('k') | tools/gn/runtime_deps.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698