Replace *Escape with *EscapeList

Follow the change to blueprint to make *Escape take and return a string
and add *EscapeList that take and return slices of strings.  Fix up
a few places that were unnecessarily converting a string to a slice
and back to a string.

Test: m nothing
Change-Id: I3fa87de175522205f36544ef76aa2f04aef1b936
diff --git a/java/aar.go b/java/aar.go
index 9eb2b27..c30632e 100644
--- a/java/aar.go
+++ b/java/aar.go
@@ -168,7 +168,7 @@
 		} else {
 			versionName = ctx.Config().AppsDefaultVersionName()
 		}
-		versionName = proptools.NinjaEscape([]string{versionName})[0]
+		versionName = proptools.NinjaEscape(versionName)
 		linkFlags = append(linkFlags, "--version-name ", versionName)
 	}
 
diff --git a/java/app_builder.go b/java/app_builder.go
index 6cc2159..bc91d55 100644
--- a/java/app_builder.go
+++ b/java/app_builder.go
@@ -224,7 +224,7 @@
 		Output:      outputFile,
 		Implicits:   deps,
 		Args: map[string]string{
-			"jarArgs": strings.Join(proptools.NinjaAndShellEscape(jarArgs), " "),
+			"jarArgs": strings.Join(proptools.NinjaAndShellEscapeList(jarArgs), " "),
 		},
 	})
 }
diff --git a/java/builder.go b/java/builder.go
index aa61a85..d8b303e 100644
--- a/java/builder.go
+++ b/java/builder.go
@@ -300,7 +300,7 @@
 		Output:      outputFile,
 		Implicits:   deps,
 		Args: map[string]string{
-			"jarArgs": strings.Join(proptools.NinjaAndShellEscape(jarArgs), " "),
+			"jarArgs": strings.Join(proptools.NinjaAndShellEscapeList(jarArgs), " "),
 		},
 	})
 }
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index ca68832..64de21a 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -281,7 +281,7 @@
 		cmd.Flag(extraFlags)
 	}
 
-	cmd.Textf(`|| ( echo %s ; false )`, proptools.ShellEscape([]string{failureMessage})[0])
+	cmd.Textf(`|| ( echo %s ; false )`, proptools.ShellEscape(failureMessage))
 
 	installDir := filepath.Join("/system/framework", arch.String())
 	vdexInstallDir := filepath.Join("/system/framework")
diff --git a/java/jacoco.go b/java/jacoco.go
index 541a84a..8b6d4ac 100644
--- a/java/jacoco.go
+++ b/java/jacoco.go
@@ -106,7 +106,7 @@
 			return nil, err
 		}
 	}
-	return proptools.NinjaAndShellEscape(specs), nil
+	return proptools.NinjaAndShellEscapeList(specs), nil
 }
 
 func jacocoFilterToSpec(filter string) (string, error) {
diff --git a/java/java.go b/java/java.go
index d230810..52d97c9 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1152,7 +1152,7 @@
 			Output:    servicesJar,
 			Implicits: services,
 			Args: map[string]string{
-				"jarArgs": "-P META-INF/services/ " + strings.Join(proptools.NinjaAndShellEscape(zipargs), " "),
+				"jarArgs": "-P META-INF/services/ " + strings.Join(proptools.NinjaAndShellEscapeList(zipargs), " "),
 			},
 		})
 		jars = append(jars, servicesJar)