Support genrules with multiple tools
To allow genrules with more than one tool, rename the tool property to
tools and make it an array, replace $tool with $(location <label>),
and use $() for other variables for consistency.
Bug: 31948427
Test: compare build.ninja
Change-Id: I20a69ff2f30715acf718a08bc195d7a938442a2d
(cherry picked from commit 1b27f616afb31974017978ffc2aecc8e4c7582cc)
diff --git a/main.cpp b/main.cpp
index 1524080..6dc5dc9 100644
--- a/main.cpp
+++ b/main.cpp
@@ -582,9 +582,9 @@
out << "genrule {\n";
out.indent();
out << "name: \"" << genName << "\",\n"
- << "tool: \"" << hidl_gen << "\",\n";
+ << "tools: [\"" << hidl_gen << "\"],\n";
- out << "cmd: \"$tool -o $genDir"
+ out << "cmd: \"$(location " << hidl_gen << ") -o $(genDir)"
<< " -L" << language
<< " -r"
<< coordinator->getPackageRoot(packageFQName) << ":"