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

Unified Diff: build/config/android/rules.gni

Issue 1428173002: GN: Remove "outputs" parameter for java_cpp_enum() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/util/build_utils.py ('k') | chrome/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
]
}
}
« no previous file with comments | « build/android/gyp/util/build_utils.py ('k') | chrome/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698