Index: build/config/android/rules.gni |
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni |
index aa0a426a0c70b8707fdedbb96ae2d465c8b681b1..8441f9f81118088004f71970bf2be01b6c1dd22a 100644 |
--- a/build/config/android/rules.gni |
+++ b/build/config/android/rules.gni |
@@ -327,72 +327,35 @@ template("java_cpp_template") { |
# enum contained in the sources files the script will generate a .java |
# file with the same name as the name of the enum. |
# |
-# outputs: list of outputs, relative to the output_dir. These paths are |
-# verified at build time by the script. To get the list programatically run: |
-# python build/android/gyp/java_cpp_enum.py \ |
-# --print_output_only . path/to/header/file.h |
-# |
# Example |
# java_cpp_enum("foo_generated_enum") { |
# sources = [ |
# "src/native_foo_header.h", |
# ] |
-# outputs = [ |
-# "org/chromium/FooEnum.java", |
-# ] |
# } |
template("java_cpp_enum") { |
- set_sources_assignment_filter([]) |
- forward_variables_from(invoker, [ "testonly" ]) |
- |
- assert(defined(invoker.sources)) |
- assert(defined(invoker.outputs)) |
- |
- generate_enum_target_name = "${target_name}__generate_enum" |
- zip_srcjar_target_name = "${target_name}__zip_srcjar" |
- final_target_name = target_name |
- |
- action(generate_enum_target_name) { |
- visibility = [ ":$zip_srcjar_target_name" ] |
- |
+ action(target_name) { |
# The sources aren't compiled so don't check their dependencies. |
check_includes = false |
+ set_sources_assignment_filter([]) |
- sources = invoker.sources |
- script = "//build/android/gyp/java_cpp_enum.py" |
- gen_dir = "${target_gen_dir}/${target_name}/enums" |
- outputs = |
- get_path_info(rebase_path(invoker.outputs, ".", gen_dir), "abspath") |
- |
- args = [] |
- foreach(output, rebase_path(outputs, root_build_dir)) { |
- args += [ |
- "--assert_file", |
- output, |
- ] |
- } |
- args += [ rebase_path(gen_dir, root_build_dir) ] |
- args += rebase_path(invoker.sources, root_build_dir) |
- } |
+ assert(defined(invoker.sources)) |
+ forward_variables_from(invoker, |
+ [ |
+ "sources", |
+ "testonly", |
+ "visibility", |
+ ]) |
- generate_enum_outputs = get_target_outputs(":$generate_enum_target_name") |
- base_gen_dir = get_label_info(":$generate_enum_target_name", "target_gen_dir") |
+ script = "//build/android/gyp/java_cpp_enum.py" |
- srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
- zip(zip_srcjar_target_name) { |
- visibility = [ ":$final_target_name" ] |
- inputs = generate_enum_outputs |
- output = srcjar_path |
- base_dir = base_gen_dir |
- deps = [ |
- ":$generate_enum_target_name", |
- ] |
- } |
+ _srcjar_path = "${target_gen_dir}/${target_name}.srcjar" |
+ _rebased_srcjar_path = rebase_path(_srcjar_path, root_build_dir) |
+ _rebased_sources = rebase_path(invoker.sources, root_build_dir) |
- group(final_target_name) { |
- forward_variables_from(invoker, [ "visibility" ]) |
- public_deps = [ |
- ":$zip_srcjar_target_name", |
+ args = [ "--srcjar=$_rebased_srcjar_path" ] + _rebased_sources |
+ outputs = [ |
+ _srcjar_path, |
] |
} |
} |