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

Side by Side Diff: mojo/public/tools/bindings/mojom.gni

Issue 1311803002: Dart: Removes dartzip (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Readme fixes Created 5 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 | « mojo/public/tools/BUILD.gn ('k') | mojo/public/tools/dart_analyze.py » ('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 import("../../mojo_sdk.gni") 5 import("../../mojo_sdk.gni")
6 6
7 # Generate C++/JavaScript/Java/Python/Dart/Go source files from mojom files. The 7 # Generate C++/JavaScript/Java/Python/Dart/Go source files from mojom files. The
8 # output files will go under the generated file directory tree with the same 8 # output files will go under the generated file directory tree with the same
9 # path as each input file. 9 # path as each input file.
10 # 10 #
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 generator_js_outputs = 142 generator_js_outputs =
143 [ "{{source_gen_dir}}/{{source_name_part}}.mojom.js" ] 143 [ "{{source_gen_dir}}/{{source_name_part}}.mojom.js" ]
144 generator_dart_outputs = 144 generator_dart_outputs =
145 [ "{{source_gen_dir}}/{{source_name_part}}.mojom.dart" ] 145 [ "{{source_gen_dir}}/{{source_name_part}}.mojom.dart" ]
146 generator_go_outputs = [ "${root_gen_dir}/go/src/{{source_dir}}/{{source_nam e_part}}/{{source_name_part}}.mojom.go" ] 146 generator_go_outputs = [ "${root_gen_dir}/go/src/{{source_dir}}/{{source_nam e_part}}/{{source_name_part}}.mojom.go" ]
147 generator_python_outputs = 147 generator_python_outputs =
148 [ "{{source_gen_dir}}/{{source_name_part}}_mojom.py" ] 148 [ "{{source_gen_dir}}/{{source_name_part}}_mojom.py" ]
149 generator_java_outputs = 149 generator_java_outputs =
150 [ "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar" ] 150 [ "{{source_gen_dir}}/{{source_name_part}}.mojom.srcjar" ]
151 } 151 }
152 generator_dart_zip_output = "$target_out_dir/$target_name.dartzip"
153 generator_python_zip_output = "$target_out_dir/${target_name}_python.pyzip" 152 generator_python_zip_output = "$target_out_dir/${target_name}_python.pyzip"
154 153
155 rebased_mojo_sdk_public_deps = [] 154 rebased_mojo_sdk_public_deps = []
156 if (defined(invoker.mojo_sdk_public_deps)) { 155 if (defined(invoker.mojo_sdk_public_deps)) {
157 foreach(sdk_dep, invoker.mojo_sdk_public_deps) { 156 foreach(sdk_dep, invoker.mojo_sdk_public_deps) {
158 # Check that the SDK dep was not mistakenly given as an absolute path. 157 # Check that the SDK dep was not mistakenly given as an absolute path.
159 assert(get_path_info(sdk_dep, "abspath") != sdk_dep) 158 assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
160 rebased_mojo_sdk_public_deps += [ rebase_path(sdk_dep, ".", mojo_root) ] 159 rebased_mojo_sdk_public_deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
161 } 160 }
162 } 161 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 226 }
228 227
229 deps = [] 228 deps = []
230 if (defined(invoker.sources)) { 229 if (defined(invoker.sources)) {
231 public_deps += [ ":$generator_target_name" ] 230 public_deps += [ ":$generator_target_name" ]
232 } 231 }
233 deps += rebased_mojo_sdk_deps 232 deps += rebased_mojo_sdk_deps
234 if (defined(invoker.deps)) { 233 if (defined(invoker.deps)) {
235 deps += invoker.deps 234 deps += invoker.deps
236 } 235 }
237 data_deps = [ ":${target_name}_dart" ]
238 if (defined(invoker.mojo_sdk_deps)) { 236 if (defined(invoker.mojo_sdk_deps)) {
239 foreach(sdk_dep, invoker.mojo_sdk_deps) { 237 foreach(sdk_dep, invoker.mojo_sdk_deps) {
240 # Check that the SDK dep was not mistakenly given as an absolute path. 238 # Check that the SDK dep was not mistakenly given as an absolute path.
241 assert(get_path_info(sdk_dep, "abspath") != sdk_dep) 239 assert(get_path_info(sdk_dep, "abspath") != sdk_dep)
242 deps += [ rebase_path(sdk_dep, ".", mojo_root) ] 240 deps += [ rebase_path(sdk_dep, ".", mojo_root) ]
243 } 241 }
244 } 242 }
245 } 243 }
246 244
247 all_deps = rebased_mojo_sdk_deps + rebased_mojo_sdk_public_deps 245 all_deps = rebased_mojo_sdk_deps + rebased_mojo_sdk_public_deps
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 args = [ 300 args = [
303 "--base-dir=$rebase_base_dir", 301 "--base-dir=$rebase_base_dir",
304 "--zip-inputs=$rebase_zip_inputs", 302 "--zip-inputs=$rebase_zip_inputs",
305 "--output=$rebase_output", 303 "--output=$rebase_output",
306 ] 304 ]
307 if (defined(invoker.sources)) { 305 if (defined(invoker.sources)) {
308 args += [ "--inputs=$rebase_inputs" ] 306 args += [ "--inputs=$rebase_inputs" ]
309 } 307 }
310 } 308 }
311 309
312 action("${target_name}_dart") {
313 script = rebase_path("mojo/public/tools/gn/zip.py", ".", mojo_root)
314
315 deps = []
316 zip_inputs = []
317
318 if (defined(invoker.sources)) {
319 inputs = process_file_template(invoker.sources, generator_dart_outputs)
320 deps += [ ":$generator_target_name" ]
321 }
322
323 foreach(d, all_deps) {
324 # Resolve the name, so that a target //mojo/something becomes
325 # //mojo/something:something and we can append "_dart" to get the dart
326 # dependency name.
327 full_name = get_label_info(d, "label_no_toolchain")
328 dep_name = get_label_info(d, "name")
329 dep_target_out_dir = get_label_info(d, "target_out_dir")
330 deps += [ "${full_name}_dart" ]
331 zip_inputs += [ "$dep_target_out_dir/$dep_name.dartzip" ]
332 }
333
334 output = generator_dart_zip_output
335 outputs = [
336 output,
337 ]
338
339 rebase_import_from =
340 rebase_path("$root_build_dir/gen/dart-gen", root_build_dir)
341 if (defined(invoker.sources)) {
342 rebase_inputs = rebase_path(inputs, root_build_dir)
343 }
344 rebase_zip_inputs = rebase_path(zip_inputs, root_build_dir)
345 rebase_output = rebase_path(output, root_build_dir)
346 args = [
347 "--base-dir=$rebase_import_from",
348 "--zip-inputs=$rebase_zip_inputs",
349 "--output=$rebase_output",
350 ]
351 if (defined(invoker.sources)) {
352 args += [ "--link-inputs=$rebase_inputs" ]
353 }
354 }
355
356 if (defined(invoker.sources)) { 310 if (defined(invoker.sources)) {
357 # The generated C++ source files. The main reason to introduce this target 311 # The generated C++ source files. The main reason to introduce this target
358 # is so that mojo/public/cpp/bindings can depend on mojom interfaces without 312 # is so that mojo/public/cpp/bindings can depend on mojom interfaces without
359 # circular dependencies. It means that the target is missing the dependency 313 # circular dependencies. It means that the target is missing the dependency
360 # on mojo/public/cpp/bindings. No external targets should depend directly on 314 # on mojo/public/cpp/bindings. No external targets should depend directly on
361 # this target *except* mojo/public/cpp/bindings and other *_cpp_sources 315 # this target *except* mojo/public/cpp/bindings and other *_cpp_sources
362 # targets. 316 # targets.
363 source_set(cpp_sources_target_name) { 317 source_set(cpp_sources_target_name) {
364 if (defined(invoker.testonly)) { 318 if (defined(invoker.testonly)) {
365 testonly = invoker.testonly 319 testonly = invoker.testonly
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 # //mojo/something:something and we can append "_java" to get the java 373 # //mojo/something:something and we can append "_java" to get the java
420 # dependency name. 374 # dependency name.
421 full_name = get_label_info(d, "label_no_toolchain") 375 full_name = get_label_info(d, "label_no_toolchain")
422 deps += [ "${full_name}_java" ] 376 deps += [ "${full_name}_java" ]
423 } 377 }
424 378
425 srcjar_deps = [ ":$java_srcjar_target_name" ] 379 srcjar_deps = [ ":$java_srcjar_target_name" ]
426 } 380 }
427 } 381 }
428 } 382 }
OLDNEW
« no previous file with comments | « mojo/public/tools/BUILD.gn ('k') | mojo/public/tools/dart_analyze.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698