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

Side by Side Diff: build/json_schema_api.gni

Issue 2257003002: [Extensions] Generate all schema resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment 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 | « no previous file | chrome/BUILD.gn » ('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 # Defines a static library corresponding to the output of schema compiler tools 5 # Defines a static library corresponding to the output of schema compiler tools
6 # over a set of extensions API schemas (IDL or JSON format.) The library target 6 # over a set of extensions API schemas (IDL or JSON format.) The library target
7 # has implicit hard dependencies on all schema files listed by the invoker and 7 # has implicit hard dependencies on all schema files listed by the invoker and
8 # is itself a hard dependency. 8 # is itself a hard dependency.
9 # 9 #
10 # Invocations of this template may use the following variables: 10 # Invocations of this template may use the following variables:
(...skipping 29 matching lines...) Expand all
40 # The path containing C++ implementations of API functions. This path is 40 # The path containing C++ implementations of API functions. This path is
41 # used as the root path when looking for {schema}/{schema}_api.h headers 41 # used as the root path when looking for {schema}/{schema}_api.h headers
42 # when generating API registration bundles. Such headers, if found, are 42 # when generating API registration bundles. Such headers, if found, are
43 # automatically included by the generated code. 43 # automatically included by the generated code.
44 # 44 #
45 # uncompiled_sources [optional, only used when bundle = true or 45 # uncompiled_sources [optional, only used when bundle = true or
46 # bundle_registration = true] 46 # bundle_registration = true]
47 # A list of schema files which should not be compiled, but which should still 47 # A list of schema files which should not be compiled, but which should still
48 # be processed for API bundle generation. 48 # be processed for API bundle generation.
49 # 49 #
50 # uncompiled_bundle_schema_sources [optional, only used when bundle = true]
51 # A list of schema files which should not be compiled nor registered, but
52 # should still be processed for the schema generation.
53 #
50 # configs [optional] 54 # configs [optional]
51 # Extra configs to apply to the compile step. 55 # Extra configs to apply to the compile step.
52 # 56 #
53 # deps [optional] 57 # deps [optional]
54 # If any deps are specified they will be inherited by the static library 58 # If any deps are specified they will be inherited by the static library
55 # target. 59 # target.
56 # 60 #
57 # generate_static_library [optional, defaults to false] 61 # generate_static_library [optional, defaults to false]
58 # Produces a static library instead of a source_set. 62 # Produces a static library instead of a source_set.
59 # 63 #
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 136
133 if (bundle) { 137 if (bundle) {
134 assert(defined(invoker.bundle_name), 138 assert(defined(invoker.bundle_name),
135 "\"bundle_name\" must be defined for bundles") 139 "\"bundle_name\" must be defined for bundles")
136 140
137 uncompiled_sources = [] 141 uncompiled_sources = []
138 if (defined(invoker.uncompiled_sources)) { 142 if (defined(invoker.uncompiled_sources)) {
139 uncompiled_sources = invoker.uncompiled_sources 143 uncompiled_sources = invoker.uncompiled_sources
140 } 144 }
141 145
146 uncompiled_bundle_schema_sources = []
147 if (defined(invoker.uncompiled_bundle_schema_sources)) {
148 uncompiled_bundle_schema_sources =
149 invoker.uncompiled_bundle_schema_sources
150 }
151
142 bundle_generator_schema_name = target_name + "_bundle_generator_schema" 152 bundle_generator_schema_name = target_name + "_bundle_generator_schema"
143 action(bundle_generator_schema_name) { 153 action(bundle_generator_schema_name) {
144 script = compiler_script 154 script = compiler_script
145 inputs = compiler_sources + invoker.sources + uncompiled_sources 155 inputs = compiler_sources + invoker.sources + uncompiled_sources
146 outputs = [ 156 outputs = [
147 "$target_gen_dir/generated_schemas.cc", 157 "$target_gen_dir/generated_schemas.cc",
148 "$target_gen_dir/generated_schemas.h", 158 "$target_gen_dir/generated_schemas.h",
149 ] 159 ]
150 args = [ 160 args = [
151 "--root=" + rebase_path("//", root_build_dir), 161 "--root=" + rebase_path("//", root_build_dir),
152 "--destdir=" + rebase_path(root_gen_dir, root_build_dir), 162 "--destdir=" + rebase_path(root_gen_dir, root_build_dir),
153 "--namespace=$root_namespace", 163 "--namespace=$root_namespace",
154 "--bundle-name=" + invoker.bundle_name, 164 "--bundle-name=" + invoker.bundle_name,
155 "--generator=cpp-bundle-schema", 165 "--generator=cpp-bundle-schema",
156 "--include-rules=$schema_include_rules", 166 "--include-rules=$schema_include_rules",
157 ] + rebase_path(invoker.sources, root_build_dir) + 167 ] + rebase_path(invoker.sources, root_build_dir) +
158 rebase_path(uncompiled_sources, root_build_dir) 168 rebase_path(uncompiled_sources, root_build_dir) +
169 rebase_path(uncompiled_bundle_schema_sources, root_build_dir)
159 } 170 }
160 } 171 }
161 172
162 if (bundle_registration) { 173 if (bundle_registration) {
163 assert(defined(invoker.bundle_name), 174 assert(defined(invoker.bundle_name),
164 "\"bundle_name\" must be defined for bundle registrations") 175 "\"bundle_name\" must be defined for bundle registrations")
165 176
166 uncompiled_sources = [] 177 uncompiled_sources = []
167 if (defined(invoker.uncompiled_sources)) { 178 if (defined(invoker.uncompiled_sources)) {
168 uncompiled_sources = invoker.uncompiled_sources 179 uncompiled_sources = invoker.uncompiled_sources
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 public_configs = [ ":$generated_config_name" ] 245 public_configs = [ ":$generated_config_name" ]
235 246
236 if (defined(invoker.visibility)) { 247 if (defined(invoker.visibility)) {
237 visibility = invoker.visibility 248 visibility = invoker.visibility
238 } 249 }
239 if (defined(invoker.output_name)) { 250 if (defined(invoker.output_name)) {
240 output_name = invoker.output_name 251 output_name = invoker.output_name
241 } 252 }
242 } 253 }
243 } 254 }
OLDNEW
« no previous file with comments | « no previous file | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698