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

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

Issue 1752033002: Add "create_bundle" target in order to support bundle with gn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-bundle-data
Patch Set: Add unit tests, address comments, update docs and format with clang-format Created 4 years, 9 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_type.h ('k') | tools/gn/target.h » ('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_type.h" 5 #include "tools/gn/substitution_type.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "tools/gn/err.h" 10 #include "tools/gn/err.h"
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 // All valid compiler outputs plus the output extension. 201 // All valid compiler outputs plus the output extension.
202 return IsValidCompilerOutputsSubstitution(type) || 202 return IsValidCompilerOutputsSubstitution(type) ||
203 type == SUBSTITUTION_OUTPUT_EXTENSION; 203 type == SUBSTITUTION_OUTPUT_EXTENSION;
204 } 204 }
205 205
206 bool IsValidCopySubstitution(SubstitutionType type) { 206 bool IsValidCopySubstitution(SubstitutionType type) {
207 return IsValidToolSubstitution(type) || 207 return IsValidToolSubstitution(type) ||
208 type == SUBSTITUTION_SOURCE; 208 type == SUBSTITUTION_SOURCE;
209 } 209 }
210 210
211 bool IsValidCompileXCassetsSubstitution(SubstitutionType type) {
212 return IsValidToolSubstitution(type) ||
213 type == SUBSTITUTION_LINKER_INPUTS;
214 }
215
211 bool EnsureValidSourcesSubstitutions( 216 bool EnsureValidSourcesSubstitutions(
212 const std::vector<SubstitutionType>& types, 217 const std::vector<SubstitutionType>& types,
213 const ParseNode* origin, 218 const ParseNode* origin,
214 Err* err) { 219 Err* err) {
215 for (size_t i = 0; i < types.size(); i++) { 220 for (size_t i = 0; i < types.size(); i++) {
216 if (!IsValidSourceSubstitution(types[i])) { 221 if (!IsValidSourceSubstitution(types[i])) {
217 *err = Err(origin, "Invalid substitution type.", 222 *err = Err(origin, "Invalid substitution type.",
218 "The substitution " + std::string(kSubstitutionNames[types[i]]) + 223 "The substitution " + std::string(kSubstitutionNames[types[i]]) +
219 " isn't valid for something\n" 224 " isn't valid for something\n"
220 "operating on a source file such as this."); 225 "operating on a source file such as this.");
221 return false; 226 return false;
222 } 227 }
223 } 228 }
224 return true; 229 return true;
225 } 230 }
OLDNEW
« no previous file with comments | « tools/gn/substitution_type.h ('k') | tools/gn/target.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698