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
This commit is contained in:
parent
7abf560cb0
commit
0b9f31fb08
|
@ -931,12 +931,12 @@ func convertBuildParams(params BuildParams) blueprint.BuildParams {
|
|||
bparams.Implicits = append(bparams.Implicits, params.Implicit.String())
|
||||
}
|
||||
|
||||
bparams.Outputs = proptools.NinjaEscape(bparams.Outputs)
|
||||
bparams.ImplicitOutputs = proptools.NinjaEscape(bparams.ImplicitOutputs)
|
||||
bparams.Inputs = proptools.NinjaEscape(bparams.Inputs)
|
||||
bparams.Implicits = proptools.NinjaEscape(bparams.Implicits)
|
||||
bparams.OrderOnly = proptools.NinjaEscape(bparams.OrderOnly)
|
||||
bparams.Depfile = proptools.NinjaEscape([]string{bparams.Depfile})[0]
|
||||
bparams.Outputs = proptools.NinjaEscapeList(bparams.Outputs)
|
||||
bparams.ImplicitOutputs = proptools.NinjaEscapeList(bparams.ImplicitOutputs)
|
||||
bparams.Inputs = proptools.NinjaEscapeList(bparams.Inputs)
|
||||
bparams.Implicits = proptools.NinjaEscapeList(bparams.Implicits)
|
||||
bparams.OrderOnly = proptools.NinjaEscapeList(bparams.OrderOnly)
|
||||
bparams.Depfile = proptools.NinjaEscapeList([]string{bparams.Depfile})[0]
|
||||
|
||||
return bparams
|
||||
}
|
||||
|
|
|
@ -240,7 +240,7 @@ func (r *RuleBuilder) Build(pctx PackageContext, ctx BuilderContext, name string
|
|||
if len(r.Commands()) > 0 {
|
||||
ctx.Build(pctx, BuildParams{
|
||||
Rule: ctx.Rule(pctx, name, blueprint.RuleParams{
|
||||
Command: strings.Join(proptools.NinjaEscape(r.Commands()), " && "),
|
||||
Command: strings.Join(proptools.NinjaEscapeList(r.Commands()), " && "),
|
||||
CommandDeps: r.Tools().Strings(),
|
||||
}),
|
||||
Implicits: r.Inputs(),
|
||||
|
|
|
@ -269,7 +269,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
|||
CheckBadCompilerFlags(ctx, "vendor.cflags", compiler.Properties.Target.Vendor.Cflags)
|
||||
CheckBadCompilerFlags(ctx, "recovery.cflags", compiler.Properties.Target.Recovery.Cflags)
|
||||
|
||||
esc := proptools.NinjaAndShellEscape
|
||||
esc := proptools.NinjaAndShellEscapeList
|
||||
|
||||
flags.CFlags = append(flags.CFlags, esc(compiler.Properties.Cflags)...)
|
||||
flags.CppFlags = append(flags.CppFlags, esc(compiler.Properties.Cppflags)...)
|
||||
|
|
|
@ -392,7 +392,7 @@ func (linker *baseLinker) linkerFlags(ctx ModuleContext, flags Flags) Flags {
|
|||
|
||||
CheckBadLinkerFlags(ctx, "ldflags", linker.Properties.Ldflags)
|
||||
|
||||
flags.LdFlags = append(flags.LdFlags, proptools.NinjaAndShellEscape(linker.Properties.Ldflags)...)
|
||||
flags.LdFlags = append(flags.LdFlags, proptools.NinjaAndShellEscapeList(linker.Properties.Ldflags)...)
|
||||
|
||||
if ctx.Host() {
|
||||
rpath_prefix := `\$$ORIGIN/`
|
||||
|
|
|
@ -69,7 +69,7 @@ func (tidy *tidyFeature) flags(ctx ModuleContext, flags Flags) Flags {
|
|||
if len(withTidyFlags) > 0 {
|
||||
flags.TidyFlags = append(flags.TidyFlags, withTidyFlags)
|
||||
}
|
||||
esc := proptools.NinjaAndShellEscape
|
||||
esc := proptools.NinjaAndShellEscapeList
|
||||
flags.TidyFlags = append(flags.TidyFlags, esc(tidy.Properties.Tidy_flags)...)
|
||||
// If TidyFlags is empty, add default header filter.
|
||||
if len(flags.TidyFlags) == 0 {
|
||||
|
|
|
@ -605,7 +605,7 @@ Usage: %s [--rewrite <regex>=<replace>] [-exclude <module>] [--extra-deps <modul
|
|||
buf := &bytes.Buffer{}
|
||||
|
||||
fmt.Fprintln(buf, "// Automatically generated with:")
|
||||
fmt.Fprintln(buf, "// pom2bp", strings.Join(proptools.ShellEscape(os.Args[1:]), " "))
|
||||
fmt.Fprintln(buf, "// pom2bp", strings.Join(proptools.ShellEscapeList(os.Args[1:]), " "))
|
||||
|
||||
for _, pom := range poms {
|
||||
var err error
|
||||
|
|
|
@ -483,7 +483,7 @@ Usage: %s [--rewrite <regex>=<replace>] [-exclude <module>] [--extra-deps <modul
|
|||
}
|
||||
|
||||
fmt.Println("# Automatically generated with:")
|
||||
fmt.Println("# pom2mk", strings.Join(proptools.ShellEscape(os.Args[1:]), " "))
|
||||
fmt.Println("# pom2mk", strings.Join(proptools.ShellEscapeList(os.Args[1:]), " "))
|
||||
fmt.Println("LOCAL_PATH := $(call my-dir)")
|
||||
|
||||
for _, pom := range poms {
|
||||
|
|
|
@ -453,7 +453,7 @@ func NewGenSrcs() *Module {
|
|||
}
|
||||
|
||||
// escape the command in case for example it contains '#', an odd number of '"', etc
|
||||
command = fmt.Sprintf("bash -c %v", proptools.ShellEscape([]string{command})[0])
|
||||
command = fmt.Sprintf("bash -c %v", proptools.ShellEscape(command))
|
||||
commands = append(commands, command)
|
||||
}
|
||||
fullCommand := strings.Join(commands, " && ")
|
||||
|
|
|
@ -168,7 +168,7 @@ func (a *aapt) aapt2Flags(ctx android.ModuleContext, sdkContext sdkContext, mani
|
|||
} else {
|
||||
versionName = ctx.Config().AppsDefaultVersionName()
|
||||
}
|
||||
versionName = proptools.NinjaEscape([]string{versionName})[0]
|
||||
versionName = proptools.NinjaEscape(versionName)
|
||||
linkFlags = append(linkFlags, "--version-name ", versionName)
|
||||
}
|
||||
|
||||
|
|
|
@ -224,7 +224,7 @@ func TransformJniLibsToJar(ctx android.ModuleContext, outputFile android.Writabl
|
|||
Output: outputFile,
|
||||
Implicits: deps,
|
||||
Args: map[string]string{
|
||||
"jarArgs": strings.Join(proptools.NinjaAndShellEscape(jarArgs), " "),
|
||||
"jarArgs": strings.Join(proptools.NinjaAndShellEscapeList(jarArgs), " "),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -300,7 +300,7 @@ func TransformResourcesToJar(ctx android.ModuleContext, outputFile android.Writa
|
|||
Output: outputFile,
|
||||
Implicits: deps,
|
||||
Args: map[string]string{
|
||||
"jarArgs": strings.Join(proptools.NinjaAndShellEscape(jarArgs), " "),
|
||||
"jarArgs": strings.Join(proptools.NinjaAndShellEscapeList(jarArgs), " "),
|
||||
},
|
||||
})
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ func buildBootImageRuleForArch(ctx android.SingletonContext, image *bootImage,
|
|||
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")
|
||||
|
|
|
@ -106,7 +106,7 @@ func jacocoFiltersToSpecs(filters []string) ([]string, error) {
|
|||
return nil, err
|
||||
}
|
||||
}
|
||||
return proptools.NinjaAndShellEscape(specs), nil
|
||||
return proptools.NinjaAndShellEscapeList(specs), nil
|
||||
}
|
||||
|
||||
func jacocoFilterToSpec(filter string) (string, error) {
|
||||
|
|
|
@ -1152,7 +1152,7 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars ...android.Path
|
|||
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)
|
||||
|
|
|
@ -67,7 +67,7 @@ func autogenTemplate(ctx android.ModuleContext, output android.WritablePath, tem
|
|||
}
|
||||
sort.Strings(options)
|
||||
extraOptions := strings.Join(options, "\n ")
|
||||
extraOptions = proptools.NinjaAndShellEscape([]string{extraOptions})[0]
|
||||
extraOptions = proptools.NinjaAndShellEscape(extraOptions)
|
||||
|
||||
ctx.Build(pctx, android.BuildParams{
|
||||
Rule: autogenTestConfig,
|
||||
|
|
Loading…
Reference in New Issue