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

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

Issue 1286613002: Update errorprone to fix java 8 issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed jbudorick's nits. Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/host_jar.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/android/internal_rules.gni
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 287a0066fba3b8270d4ad585890bfb451891a87c..df7b44eedc056abc11b20c916c10ffee3c7f64ba 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -114,6 +114,43 @@ template("findbugs") {
}
}
+# Generates a script in the output bin.java directory to run a java binary.
+template("java_binary_script") {
+ set_sources_assignment_filter([])
+ forward_variables_from(invoker, [ "testonly" ])
+
+ _main_class = invoker.main_class
+ _build_config = invoker.build_config
+ _jar_path = invoker.jar_path
+ _script_name = invoker.script_name
+
+ action(target_name) {
+ script = "//build/android/gyp/create_java_binary_script.py"
+ depfile = "$target_gen_dir/$_script_name.d"
+ java_script = "$root_build_dir/bin/$_script_name"
+ inputs = [
+ _build_config,
+ ]
+ outputs = [
+ depfile,
+ java_script,
+ ]
+ forward_variables_from(invoker, [ "deps" ])
+ _rebased_build_config = rebase_path(_build_config, root_build_dir)
+ args = [
+ "--depfile",
+ rebase_path(depfile, root_build_dir),
+ "--output",
+ rebase_path(java_script, root_build_dir),
+ "--classpath=@FileArg($_rebased_build_config:java:full_classpath)",
+ "--jar-path",
+ rebase_path(_jar_path, root_build_dir),
+ "--main-class",
+ _main_class,
+ ]
+ }
+}
+
template("dex") {
set_sources_assignment_filter([])
@@ -845,6 +882,19 @@ template("java_prebuilt_impl") {
}
}
+ if (defined(invoker.main_class)) {
+ binary_script_target_name = "${_template_name}__java_binary_script"
+ java_binary_script(binary_script_target_name) {
+ build_config = _build_config
+ jar_path = _jar_path
+ main_class = invoker.main_class
+ script_name = _template_name
+ deps = [
+ ":$build_config_target_name",
+ ]
+ }
+ }
+
group(target_name) {
forward_variables_from(invoker, [ "data_deps" ])
deps = [
@@ -853,6 +903,13 @@ template("java_prebuilt_impl") {
if (_supports_android) {
deps += [ ":$dex_target_name" ]
}
+ data_deps = []
+ if (defined(invoker.data_deps)) {
+ data_deps += invoker.data_deps
+ }
+ if (defined(invoker.main_class)) {
+ data_deps += [ ":$binary_script_target_name" ]
+ }
}
}
@@ -1140,31 +1197,12 @@ template("java_library_impl") {
}
if (defined(invoker.main_class)) {
- _final_deps += [ ":${_template_name}__binary_script" ]
- action("${_template_name}__binary_script") {
- script = "//build/android/gyp/create_java_binary_script.py"
- depfile = "$target_gen_dir/$target_name.d"
- java_script = "$root_build_dir/bin/$_template_name"
- inputs = [
- _build_config,
- ]
- outputs = [
- depfile,
- java_script,
- ]
- _rebased_build_config = rebase_path(_build_config, root_build_dir)
- args = [
- "--depfile",
- rebase_path(depfile, root_build_dir),
- "--output",
- rebase_path(java_script, root_build_dir),
- "--classpath=@FileArg($_rebased_build_config:java:full_classpath)",
- "--jar-path",
- rebase_path(_jar_path, root_build_dir),
- "--main-class",
- invoker.main_class,
- ]
-
+ _final_datadeps += [ ":${_template_name}__java_binary_script" ]
+ java_binary_script("${_template_name}__java_binary_script") {
+ build_config = _build_config
+ jar_path = _jar_path
+ main_class = invoker.main_class
+ script_name = _template_name
deps = build_config_deps
}
}
« no previous file with comments | « build/android/gyp/javac.py ('k') | build/host_jar.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698