diff options
Diffstat (limited to 'java/builder.go')
-rw-r--r-- | java/builder.go | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/java/builder.go b/java/builder.go index b5dc88a66..417a7fa54 100644 --- a/java/builder.go +++ b/java/builder.go @@ -313,7 +313,7 @@ func TransformJavaToHeaderClasses(ctx android.ModuleContext, outputFile android. // ensure turbine does not fall back to the default bootclasspath. bootClasspath = `--bootclasspath ""` } else { - bootClasspath = strings.Join(flags.bootClasspath.FormTurbineClasspath("--bootclasspath "), " ") + bootClasspath = flags.bootClasspath.FormTurbineClassPath("--bootclasspath ") } } @@ -330,7 +330,7 @@ func TransformJavaToHeaderClasses(ctx android.ModuleContext, outputFile android. "javacFlags": flags.javacFlags, "bootClasspath": bootClasspath, "srcJars": strings.Join(srcJars.Strings(), " "), - "classpath": strings.Join(classpath.FormTurbineClasspath("--classpath "), " "), + "classpath": classpath.FormTurbineClassPath("--classpath "), "outDir": android.PathForModuleOut(ctx, "turbine", "classes").String(), "javaVersion": flags.javaVersion.String(), }, @@ -523,18 +523,26 @@ func TransformZipAlign(ctx android.ModuleContext, outputFile android.WritablePat type classpath android.Paths -func (x *classpath) FormJavaClassPath(optName string) string { +func (x *classpath) formJoinedClassPath(optName string, sep string) string { if optName != "" && !strings.HasSuffix(optName, "=") && !strings.HasSuffix(optName, " ") { optName += " " } if len(*x) > 0 { - return optName + strings.Join(x.Strings(), ":") + return optName + strings.Join(x.Strings(), sep) } else { return "" } } +func (x *classpath) FormJavaClassPath(optName string) string { + return x.formJoinedClassPath(optName, ":") +} + +func (x *classpath) FormTurbineClassPath(optName string) string { + return x.formJoinedClassPath(optName, " ") +} -func (x *classpath) FormTurbineClasspath(optName string) []string { +// FormRepeatedClassPath returns a list of arguments with the given optName prefixed to each element of the classpath. +func (x *classpath) FormRepeatedClassPath(optName string) []string { if x == nil || *x == nil { return nil } |