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

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

Issue 583363003: GN: Fix dependency output file handling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/substitution_pattern.h ('k') | tools/gn/target.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/substitution_pattern.h" 5 #include "tools/gn/substitution_pattern.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "tools/gn/build_settings.h" 8 #include "tools/gn/build_settings.h"
9 #include "tools/gn/err.h" 9 #include "tools/gn/err.h"
10 #include "tools/gn/filesystem_utils.h" 10 #include "tools/gn/filesystem_utils.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 origin_ = origin; 85 origin_ = origin;
86 86
87 // Fill required types vector. 87 // Fill required types vector.
88 SubstitutionBits bits; 88 SubstitutionBits bits;
89 FillRequiredTypes(&bits); 89 FillRequiredTypes(&bits);
90 bits.FillVector(&required_types_); 90 bits.FillVector(&required_types_);
91 return true; 91 return true;
92 } 92 }
93 93
94 // static
95 SubstitutionPattern SubstitutionPattern::MakeForTest(const char* str) {
96 Err err;
97 SubstitutionPattern pattern;
98 CHECK(pattern.Parse(str, NULL, &err)) << err.message();
99 return pattern;
100 }
101
94 std::string SubstitutionPattern::AsString() const { 102 std::string SubstitutionPattern::AsString() const {
95 std::string result; 103 std::string result;
96 for (size_t i = 0; i < ranges_.size(); i++) { 104 for (size_t i = 0; i < ranges_.size(); i++) {
97 if (ranges_[i].type == SUBSTITUTION_LITERAL) 105 if (ranges_[i].type == SUBSTITUTION_LITERAL)
98 result.append(ranges_[i].literal); 106 result.append(ranges_[i].literal);
99 else 107 else
100 result.append(kSubstitutionNames[ranges_[i].type]); 108 result.append(kSubstitutionNames[ranges_[i].type]);
101 } 109 }
102 return result; 110 return result;
103 } 111 }
(...skipping 26 matching lines...) Expand all
130 "File is not inside output directory.", 138 "File is not inside output directory.",
131 "The given file should be in the output directory. Normally you\n" 139 "The given file should be in the output directory. Normally you\n"
132 "would specify\n\"$target_out_dir/foo\" or " 140 "would specify\n\"$target_out_dir/foo\" or "
133 "\"{{source_gen_dir}}/foo\"."); 141 "\"{{source_gen_dir}}/foo\".");
134 return false; 142 return false;
135 } 143 }
136 } 144 }
137 145
138 return true; 146 return true;
139 } 147 }
OLDNEW
« no previous file with comments | « tools/gn/substitution_pattern.h ('k') | tools/gn/target.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698