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: I3d714f70a2af0dc60faeee10e09b6ed166601f1d
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 0d800be..004d7d2 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -2,8 +2,8 @@
 
 genrule {
     name: "android.hardware.graphics.allocator@2.0_genc++",
-    tool: "hidl-gen",
-    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.allocator@2.0",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.allocator@2.0",
     srcs: [
         "types.hal",
         "IAllocator.hal",
@@ -16,8 +16,8 @@
 
 genrule {
     name: "android.hardware.graphics.allocator@2.0_genc++_headers",
-    tool: "hidl-gen",
-    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.allocator@2.0",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.allocator@2.0",
     srcs: [
         "types.hal",
         "IAllocator.hal",
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index ba66f94..fa95ca0 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -2,8 +2,8 @@
 
 genrule {
     name: "android.hardware.graphics.common@1.0_genc++",
-    tool: "hidl-gen",
-    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.common@1.0",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.common@1.0",
     srcs: [
         "types.hal",
     ],
@@ -14,8 +14,8 @@
 
 genrule {
     name: "android.hardware.graphics.common@1.0_genc++_headers",
-    tool: "hidl-gen",
-    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.common@1.0",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.common@1.0",
     srcs: [
         "types.hal",
     ],
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index bc948e8..0015861 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -2,8 +2,8 @@
 
 genrule {
     name: "android.hardware.graphics.composer@2.1_genc++",
-    tool: "hidl-gen",
-    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.composer@2.1",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.composer@2.1",
     srcs: [
         "types.hal",
         "IComposer.hal",
@@ -18,8 +18,8 @@
 
 genrule {
     name: "android.hardware.graphics.composer@2.1_genc++_headers",
-    tool: "hidl-gen",
-    cmd: "$tool -o $genDir -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.composer@2.1",
+    tools: ["hidl-gen"],
+    cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.graphics.composer@2.1",
     srcs: [
         "types.hal",
         "IComposer.hal",