Chromium Code Reviews| OLD | NEW |
|---|---|
| 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("//base/android/linker/config.gni") | 5 import("//base/android/linker/config.gni") |
| 6 import("//build/config/android/config.gni") | 6 import("//build/config/android/config.gni") |
| 7 import("//build/config/android/internal_rules.gni") | 7 import("//build/config/android/internal_rules.gni") |
| 8 import("//tools/grit/grit_rule.gni") | 8 import("//tools/grit/grit_rule.gni") |
| 9 import("//tools/relocation_packer/config.gni") | 9 import("//tools/relocation_packer/config.gni") |
| 10 | 10 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 316 # android_library target's srcjar_deps will make the generated java files be | 316 # android_library target's srcjar_deps will make the generated java files be |
| 317 # included in that library's final outputs. | 317 # included in that library's final outputs. |
| 318 # | 318 # |
| 319 # Variables | 319 # Variables |
| 320 # sources: list of files to be processed by the script. For each annotated | 320 # sources: list of files to be processed by the script. For each annotated |
| 321 # enum contained in the sources files the script will generate a .java | 321 # enum contained in the sources files the script will generate a .java |
| 322 # file with the same name as the name of the enum. | 322 # file with the same name as the name of the enum. |
| 323 # | 323 # |
| 324 # outputs: list of outputs, relative to the output_dir. These paths are | 324 # outputs: list of outputs, relative to the output_dir. These paths are |
| 325 # verified at build time by the script. To get the list programatically run: | 325 # verified at build time by the script. To get the list programatically run: |
| 326 # python build/android/gyp/java_cpp_enum.py --output_dir=. \ | 326 # python build/android/gyp/java_cpp_enum.py \ |
| 327 # --print_output_only path/to/header/file.h | 327 # --print_output_only . path/to/header/file.h |
| 328 # | 328 # |
| 329 # Example | 329 # Example |
| 330 # java_cpp_enum("foo_generated_enum") { | 330 # java_cpp_enum("foo_generated_enum") { |
| 331 # sources = [ | 331 # sources = [ |
| 332 # "src/native_foo_header.h", | 332 # "src/native_foo_header.h", |
| 333 # ] | 333 # ] |
| 334 # outputs = [ | 334 # outputs = [ |
| 335 # "org/chromium/FooEnum.java", | 335 # "org/chromium/FooEnum.java", |
| 336 # ] | 336 # ] |
| 337 # } | 337 # } |
| 338 template("java_cpp_enum") { | 338 template("java_cpp_enum") { |
| 339 set_sources_assignment_filter([]) | 339 set_sources_assignment_filter([]) |
| 340 if (defined(invoker.testonly)) { | 340 if (defined(invoker.testonly)) { |
| 341 testonly = invoker.testonly | 341 testonly = invoker.testonly |
| 342 } | 342 } |
| 343 | 343 |
| 344 assert(defined(invoker.sources)) | 344 assert(defined(invoker.sources)) |
| 345 assert(defined(invoker.outputs)) | 345 assert(defined(invoker.outputs)) |
| 346 | 346 |
| 347 action("${target_name}__generate_enum") { | 347 action("${target_name}__generate_enum") { |
| 348 sources = invoker.sources | 348 sources = invoker.sources |
| 349 script = "//build/android/gyp/java_cpp_enum.py" | 349 script = "//build/android/gyp/java_cpp_enum.py" |
| 350 gen_dir = "${target_gen_dir}/${target_name}/enums" | 350 gen_dir = "${target_gen_dir}/${target_name}/enums" |
| 351 outputs = | 351 outputs = |
| 352 get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") | 352 get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") |
| 353 | 353 |
| 354 args = [ | 354 args = [] |
| 355 "--output_dir", | |
| 356 rebase_path(gen_dir, root_build_dir), | |
| 357 ] | |
| 358 foreach(output, rebase_path(outputs, root_build_dir)) { | 355 foreach(output, rebase_path(outputs, root_build_dir)) { |
| 359 args += [ | 356 args += [ |
| 360 "--assert_file", | 357 "--assert_file", |
| 361 output, | 358 output, |
| 362 ] | 359 ] |
| 363 } | 360 } |
| 361 args += rebase_path(gen_dir, root_build_dir) | |
|
cjhopman
2015/02/17 21:38:25
gen_dir is a string (invoker.sources below is a li
mnaganov (inactive)
2015/02/23 11:35:26
I was supposing that gn can handle coercion itself
| |
| 364 args += rebase_path(invoker.sources, root_build_dir) | 362 args += rebase_path(invoker.sources, root_build_dir) |
| 365 } | 363 } |
| 366 | 364 |
| 367 generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum") | 365 generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum") |
| 368 base_gen_dir = | 366 base_gen_dir = |
| 369 get_label_info(":${target_name}__generate_enum", "target_gen_dir") | 367 get_label_info(":${target_name}__generate_enum", "target_gen_dir") |
| 370 | 368 |
| 371 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 369 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
| 372 zip("${target_name}__zip_srcjar") { | 370 zip("${target_name}__zip_srcjar") { |
| 373 inputs = generate_enum_outputs | 371 inputs = generate_enum_outputs |
| (...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1727 template("uiautomator_test") { | 1725 template("uiautomator_test") { |
| 1728 set_sources_assignment_filter([]) | 1726 set_sources_assignment_filter([]) |
| 1729 if (defined(invoker.testonly)) { | 1727 if (defined(invoker.testonly)) { |
| 1730 testonly = invoker.testonly | 1728 testonly = invoker.testonly |
| 1731 } | 1729 } |
| 1732 assert(target_name != "") | 1730 assert(target_name != "") |
| 1733 assert(invoker.deps != [] || true) | 1731 assert(invoker.deps != [] || true) |
| 1734 group(target_name) { | 1732 group(target_name) { |
| 1735 } | 1733 } |
| 1736 } | 1734 } |
| OLD | NEW |