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

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

Issue 1663103004: Create wrapper scripts that set --output-directory (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@adb_gdb-explicit
Patch Set: review comments & run_benchmark Created 4 years, 10 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
Index: build/config/android/rules.gni
diff --git a/build/config/android/rules.gni b/build/config/android/rules.gni
index 669f64606f0bd8ffdcc47b6d929b00ba3ed00b39..22d26069ab1261964a1d5edda007c74a09e752f5 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -2291,3 +2291,44 @@ template("proto_java_library") {
]
}
}
+
+# Writes a script to root_out_dir/bin that passes --output-directory to the
+# wrapped script, in addition to forwarding arguments. Most / all of these
+# wrappers should be made deps of //tools/android:android_tools.
+#
+# Variables
+# target: Script to wrap.
+# flag_name: Default is "--output-directory"
+#
+# Example
+# wrapper_script("foo_wrapper") {
+# target = "//pkg/foo.py"
+# }
+template("wrapper_script") {
+ action(target_name) {
+ _name = get_path_info(invoker.target, "name")
+ _output = "$root_out_dir/bin/$_name"
+
+ script = "//build/android/gyp/create_tool_wrapper.py"
+ outputs = [
+ _output,
+ ]
+
+ # The target isn't actually used by the script, but it's nice to have GN
+ # check that it exists.
+ inputs = [
+ invoker.target,
+ ]
+ args = [
+ "--output",
+ rebase_path(_output, root_build_dir),
+ "--target",
+ rebase_path(invoker.target, root_build_dir),
+ "--output-directory",
+ rebase_path(root_out_dir, root_build_dir),
+ ]
+ if (defined(invoker.flag_name)) {
+ args += [ "--flag-name=${invoker.flag_name}" ]
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698