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

Unified Diff: build/compiled_action.gni

Issue 1325783005: GN: Respect testonly in compiled_action and compiled_action_foreach (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/compiled_action.gni
diff --git a/build/compiled_action.gni b/build/compiled_action.gni
index b6d0c4d773df0c8a0c7fd041a4e0fc5608dcd737..855df7a6e68da80f27ce978bd6c38d68d1a7c26e 100644
--- a/build/compiled_action.gni
+++ b/build/compiled_action.gni
@@ -81,19 +81,19 @@ template("compiled_action") {
"compiled_action doesn't take a sources arg. Use inputs instead.")
action(target_name) {
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
+ deps = []
+ inputs = []
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "inputs",
+ "outputs",
+ "testonly",
+ "visibility",
+ ])
script = "//build/gn_run_binary.py"
- if (defined(invoker.inputs)) {
- inputs = invoker.inputs
- } else {
- inputs = []
- }
- outputs = invoker.outputs
-
# Constuct the host toolchain version of the tool.
host_tool = invoker.tool + "($host_toolchain)"
@@ -109,12 +109,7 @@ template("compiled_action") {
# Add the executable itself as an input.
inputs += [ host_executable ]
- deps = [
- host_tool,
- ]
- if (defined(invoker.deps)) {
- deps += invoker.deps
- }
+ deps += [ host_tool ]
# The script takes as arguments the binary to run, and then the arguments
# to pass it.
@@ -129,20 +124,19 @@ template("compiled_action_foreach") {
assert(defined(invoker.args), "args must be defined for $target_name")
action_foreach(target_name) {
- # Otherwise this is a standalone action, define visibility if requested.
- if (defined(invoker.visibility)) {
- visibility = invoker.visibility
- }
+ deps = []
+ inputs = []
+ forward_variables_from(invoker,
+ [
+ "deps",
+ "inputs",
+ "outputs",
+ "sources",
+ "testonly",
+ "visibility",
+ ])
script = "//build/gn_run_binary.py"
- sources = invoker.sources
-
- if (defined(invoker.inputs)) {
- inputs = invoker.inputs
- } else {
- inputs = []
- }
- outputs = invoker.outputs
# Constuct the host toolchain version of the tool.
host_tool = invoker.tool + "($host_toolchain)"
@@ -159,12 +153,7 @@ template("compiled_action_foreach") {
# Add the executable itself as an input.
inputs += [ host_executable ]
- deps = [
- host_tool,
- ]
- if (defined(invoker.deps)) {
- deps += invoker.deps
- }
+ deps += [ host_tool ]
# The script takes as arguments the binary to run, and then the arguments
# to pass it.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698