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

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: todo + adb_gdb 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
« no previous file with comments | « build/android/gyp/create_tool_wrapper.py ('k') | third_party/android_platform/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 d72242c1225605a2b64775a2f8ccdd7e22281348..a953c4529e975d328f642179b0c1ea9db3cfa45e 100644
--- a/build/config/android/rules.gni
+++ b/build/config/android/rules.gni
@@ -2327,3 +2327,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}" ]
+ }
+ }
+}
« no previous file with comments | « build/android/gyp/create_tool_wrapper.py ('k') | third_party/android_platform/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698