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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 # android_library target's srcjar_deps will make the generated java files be | 328 # android_library target's srcjar_deps will make the generated java files be |
329 # included in that library's final outputs. | 329 # included in that library's final outputs. |
330 # | 330 # |
331 # Variables | 331 # Variables |
332 # sources: list of files to be processed by the script. For each annotated | 332 # sources: list of files to be processed by the script. For each annotated |
333 # enum contained in the sources files the script will generate a .java | 333 # enum contained in the sources files the script will generate a .java |
334 # file with the same name as the name of the enum. | 334 # file with the same name as the name of the enum. |
335 # | 335 # |
336 # outputs: list of outputs, relative to the output_dir. These paths are | 336 # outputs: list of outputs, relative to the output_dir. These paths are |
337 # verified at build time by the script. To get the list programatically run: | 337 # verified at build time by the script. To get the list programatically run: |
338 # python build/android/gyp/java_cpp_enum.py --output_dir=. \ | 338 # python build/android/gyp/java_cpp_enum.py \ |
339 # --print_output_only path/to/header/file.h | 339 # --print_output_only . path/to/header/file.h |
340 # | 340 # |
341 # Example | 341 # Example |
342 # java_cpp_enum("foo_generated_enum") { | 342 # java_cpp_enum("foo_generated_enum") { |
343 # sources = [ | 343 # sources = [ |
344 # "src/native_foo_header.h", | 344 # "src/native_foo_header.h", |
345 # ] | 345 # ] |
346 # outputs = [ | 346 # outputs = [ |
347 # "org/chromium/FooEnum.java", | 347 # "org/chromium/FooEnum.java", |
348 # ] | 348 # ] |
349 # } | 349 # } |
350 template("java_cpp_enum") { | 350 template("java_cpp_enum") { |
351 set_sources_assignment_filter([]) | 351 set_sources_assignment_filter([]) |
352 if (defined(invoker.testonly)) { | 352 if (defined(invoker.testonly)) { |
353 testonly = invoker.testonly | 353 testonly = invoker.testonly |
354 } | 354 } |
355 | 355 |
356 assert(defined(invoker.sources)) | 356 assert(defined(invoker.sources)) |
357 assert(defined(invoker.outputs)) | 357 assert(defined(invoker.outputs)) |
358 | 358 |
359 action("${target_name}__generate_enum") { | 359 action("${target_name}__generate_enum") { |
360 # The sources aren't compiled so don't check their dependencies. | 360 # The sources aren't compiled so don't check their dependencies. |
361 check_includes = false | 361 check_includes = false |
362 | 362 |
363 sources = invoker.sources | 363 sources = invoker.sources |
364 script = "//build/android/gyp/java_cpp_enum.py" | 364 script = "//build/android/gyp/java_cpp_enum.py" |
365 gen_dir = "${target_gen_dir}/${target_name}/enums" | 365 gen_dir = "${target_gen_dir}/${target_name}/enums" |
366 outputs = | 366 outputs = |
367 get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") | 367 get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") |
368 | 368 |
369 args = [ | 369 args = [] |
370 "--output_dir", | |
371 rebase_path(gen_dir, root_build_dir), | |
372 ] | |
373 foreach(output, rebase_path(outputs, root_build_dir)) { | 370 foreach(output, rebase_path(outputs, root_build_dir)) { |
374 args += [ | 371 args += [ |
375 "--assert_file", | 372 "--assert_file", |
376 output, | 373 output, |
377 ] | 374 ] |
378 } | 375 } |
| 376 args += [ rebase_path(gen_dir, root_build_dir) ] |
379 args += rebase_path(invoker.sources, root_build_dir) | 377 args += rebase_path(invoker.sources, root_build_dir) |
380 } | 378 } |
381 | 379 |
382 generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum") | 380 generate_enum_outputs = get_target_outputs(":${target_name}__generate_enum") |
383 base_gen_dir = | 381 base_gen_dir = |
384 get_label_info(":${target_name}__generate_enum", "target_gen_dir") | 382 get_label_info(":${target_name}__generate_enum", "target_gen_dir") |
385 | 383 |
386 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" | 384 srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
387 zip("${target_name}__zip_srcjar") { | 385 zip("${target_name}__zip_srcjar") { |
388 inputs = generate_enum_outputs | 386 inputs = generate_enum_outputs |
(...skipping 1356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1745 template("uiautomator_test") { | 1743 template("uiautomator_test") { |
1746 set_sources_assignment_filter([]) | 1744 set_sources_assignment_filter([]) |
1747 if (defined(invoker.testonly)) { | 1745 if (defined(invoker.testonly)) { |
1748 testonly = invoker.testonly | 1746 testonly = invoker.testonly |
1749 } | 1747 } |
1750 assert(target_name != "") | 1748 assert(target_name != "") |
1751 assert(invoker.deps != [] || true) | 1749 assert(invoker.deps != [] || true) |
1752 group(target_name) { | 1750 group(target_name) { |
1753 } | 1751 } |
1754 } | 1752 } |
OLD | NEW |