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

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

Issue 2239943002: Forward bundle product_type to the compile_xcassets tool. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix grammar. Created 4 years, 4 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') | no next file » | 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 "{{output_dir}}", // SUBSTITUTION_OUTPUT_DIR 46 "{{output_dir}}", // SUBSTITUTION_OUTPUT_DIR
47 "{{output_extension}}", // SUBSTITUTION_OUTPUT_EXTENSION 47 "{{output_extension}}", // SUBSTITUTION_OUTPUT_EXTENSION
48 "{{solibs}}", // SUBSTITUTION_SOLIBS 48 "{{solibs}}", // SUBSTITUTION_SOLIBS
49 49
50 "{{arflags}}", // SUBSTITUTION_ARFLAGS 50 "{{arflags}}", // SUBSTITUTION_ARFLAGS
51 51
52 "{{bundle_root_dir}}", // SUBSTITUTION_BUNDLE_ROOT_DIR 52 "{{bundle_root_dir}}", // SUBSTITUTION_BUNDLE_ROOT_DIR
53 "{{bundle_resources_dir}}", // SUBSTITUTION_BUNDLE_RESOURCES_DIR 53 "{{bundle_resources_dir}}", // SUBSTITUTION_BUNDLE_RESOURCES_DIR
54 "{{bundle_executable_dir}}", // SUBSTITUTION_BUNDLE_EXECUTABLE_DIR 54 "{{bundle_executable_dir}}", // SUBSTITUTION_BUNDLE_EXECUTABLE_DIR
55 "{{bundle_plugins_dir}}", // SUBSTITUTION_BUNDLE_PLUGINS_DIR 55 "{{bundle_plugins_dir}}", // SUBSTITUTION_BUNDLE_PLUGINS_DIR
56 "{{bundle_product_type}}", // SUBSTITUTION_BUNDLE_PRODUCT_TYPE
56 57
57 "{{response_file_name}}", // SUBSTITUTION_RSP_FILE_NAME 58 "{{response_file_name}}", // SUBSTITUTION_RSP_FILE_NAME
58 }; 59 };
59 60
60 const char* kSubstitutionNinjaNames[SUBSTITUTION_NUM_TYPES] = { 61 const char* kSubstitutionNinjaNames[SUBSTITUTION_NUM_TYPES] = {
61 nullptr, // SUBSTITUTION_LITERAL 62 nullptr, // SUBSTITUTION_LITERAL
62 63
63 "in", // SUBSTITUTION_SOURCE 64 "in", // SUBSTITUTION_SOURCE
64 "out", // SUBSTITUTION_OUTPUT 65 "out", // SUBSTITUTION_OUTPUT
65 66
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 "output_dir", // SUBSTITUTION_OUTPUT_DIR 98 "output_dir", // SUBSTITUTION_OUTPUT_DIR
98 "output_extension", // SUBSTITUTION_OUTPUT_EXTENSION 99 "output_extension", // SUBSTITUTION_OUTPUT_EXTENSION
99 "solibs", // SUBSTITUTION_SOLIBS 100 "solibs", // SUBSTITUTION_SOLIBS
100 101
101 "arflags", // SUBSTITUTION_ARFLAGS 102 "arflags", // SUBSTITUTION_ARFLAGS
102 103
103 "bundle_root_dir", // SUBSTITUTION_BUNDLE_ROOT_DIR 104 "bundle_root_dir", // SUBSTITUTION_BUNDLE_ROOT_DIR
104 "bundle_resources_dir", // SUBSTITUTION_BUNDLE_RESOURCES_DIR 105 "bundle_resources_dir", // SUBSTITUTION_BUNDLE_RESOURCES_DIR
105 "bundle_executable_dir", // SUBSTITUTION_BUNDLE_EXECUTABLE_DIR 106 "bundle_executable_dir", // SUBSTITUTION_BUNDLE_EXECUTABLE_DIR
106 "bundle_plugins_dir", // SUBSTITUTION_BUNDLE_PLUGINS_DIR 107 "bundle_plugins_dir", // SUBSTITUTION_BUNDLE_PLUGINS_DIR
108 "product_type", // SUBSTITUTION_BUNDLE_PRODUCT_TYPE
107 109
108 "rspfile", // SUBSTITUTION_RSP_FILE_NAME 110 "rspfile", // SUBSTITUTION_RSP_FILE_NAME
109 }; 111 };
110 112
111 SubstitutionBits::SubstitutionBits() : used() { 113 SubstitutionBits::SubstitutionBits() : used() {
112 } 114 }
113 115
114 void SubstitutionBits::MergeFrom(const SubstitutionBits& other) { 116 void SubstitutionBits::MergeFrom(const SubstitutionBits& other) {
115 for (size_t i = 0; i < SUBSTITUTION_NUM_TYPES; i++) 117 for (size_t i = 0; i < SUBSTITUTION_NUM_TYPES; i++)
116 used[i] |= other.used[i]; 118 used[i] |= other.used[i];
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 type == SUBSTITUTION_OUTPUT_EXTENSION; 222 type == SUBSTITUTION_OUTPUT_EXTENSION;
221 } 223 }
222 224
223 bool IsValidCopySubstitution(SubstitutionType type) { 225 bool IsValidCopySubstitution(SubstitutionType type) {
224 return IsValidToolSubstitution(type) || 226 return IsValidToolSubstitution(type) ||
225 type == SUBSTITUTION_SOURCE; 227 type == SUBSTITUTION_SOURCE;
226 } 228 }
227 229
228 bool IsValidCompileXCassetsSubstitution(SubstitutionType type) { 230 bool IsValidCompileXCassetsSubstitution(SubstitutionType type) {
229 return IsValidToolSubstitution(type) || 231 return IsValidToolSubstitution(type) ||
230 type == SUBSTITUTION_LINKER_INPUTS; 232 type == SUBSTITUTION_LINKER_INPUTS ||
233 type == SUBSTITUTION_BUNDLE_PRODUCT_TYPE;
231 } 234 }
232 235
233 bool EnsureValidSourcesSubstitutions( 236 bool EnsureValidSourcesSubstitutions(
234 const std::vector<SubstitutionType>& types, 237 const std::vector<SubstitutionType>& types,
235 const ParseNode* origin, 238 const ParseNode* origin,
236 Err* err) { 239 Err* err) {
237 for (size_t i = 0; i < types.size(); i++) { 240 for (size_t i = 0; i < types.size(); i++) {
238 if (!IsValidSourceSubstitution(types[i])) { 241 if (!IsValidSourceSubstitution(types[i])) {
239 *err = Err(origin, "Invalid substitution type.", 242 *err = Err(origin, "Invalid substitution type.",
240 "The substitution " + std::string(kSubstitutionNames[types[i]]) + 243 "The substitution " + std::string(kSubstitutionNames[types[i]]) +
241 " isn't valid for something\n" 244 " isn't valid for something\n"
242 "operating on a source file such as this."); 245 "operating on a source file such as this.");
243 return false; 246 return false;
244 } 247 }
245 } 248 }
246 return true; 249 return true;
247 } 250 }
OLDNEW
« no previous file with comments | « tools/gn/substitution_type.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698