Fix turbine classpath arguments
We were passing "--classpath foo.jar --classpath bar.jar" to turbine, it now wants (and may always have expected?) "--classpath foo.jar bar.jar". Test: m checkbuild Change-Id: Ib7e0ca64a34e236110f7b785d6a0fb51ed75567e
This commit is contained in:
@@ -313,7 +313,7 @@ func TransformJavaToHeaderClasses(ctx android.ModuleContext, outputFile android.
|
|||||||
// ensure turbine does not fall back to the default bootclasspath.
|
// ensure turbine does not fall back to the default bootclasspath.
|
||||||
bootClasspath = `--bootclasspath ""`
|
bootClasspath = `--bootclasspath ""`
|
||||||
} else {
|
} 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,
|
"javacFlags": flags.javacFlags,
|
||||||
"bootClasspath": bootClasspath,
|
"bootClasspath": bootClasspath,
|
||||||
"srcJars": strings.Join(srcJars.Strings(), " "),
|
"srcJars": strings.Join(srcJars.Strings(), " "),
|
||||||
"classpath": strings.Join(classpath.FormTurbineClasspath("--classpath "), " "),
|
"classpath": classpath.FormTurbineClassPath("--classpath "),
|
||||||
"outDir": android.PathForModuleOut(ctx, "turbine", "classes").String(),
|
"outDir": android.PathForModuleOut(ctx, "turbine", "classes").String(),
|
||||||
"javaVersion": flags.javaVersion.String(),
|
"javaVersion": flags.javaVersion.String(),
|
||||||
},
|
},
|
||||||
@@ -523,18 +523,26 @@ func TransformZipAlign(ctx android.ModuleContext, outputFile android.WritablePat
|
|||||||
|
|
||||||
type classpath android.Paths
|
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, " ") {
|
if optName != "" && !strings.HasSuffix(optName, "=") && !strings.HasSuffix(optName, " ") {
|
||||||
optName += " "
|
optName += " "
|
||||||
}
|
}
|
||||||
if len(*x) > 0 {
|
if len(*x) > 0 {
|
||||||
return optName + strings.Join(x.Strings(), ":")
|
return optName + strings.Join(x.Strings(), sep)
|
||||||
} else {
|
} else {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
func (x *classpath) FormJavaClassPath(optName string) string {
|
||||||
|
return x.formJoinedClassPath(optName, ":")
|
||||||
|
}
|
||||||
|
|
||||||
func (x *classpath) FormTurbineClasspath(optName string) []string {
|
func (x *classpath) FormTurbineClassPath(optName string) string {
|
||||||
|
return x.formJoinedClassPath(optName, " ")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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 {
|
if x == nil || *x == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@@ -85,8 +85,8 @@ func (j *Module) dexCommonFlags(ctx android.ModuleContext) []string {
|
|||||||
func (j *Module) d8Flags(ctx android.ModuleContext, flags javaBuilderFlags) ([]string, android.Paths) {
|
func (j *Module) d8Flags(ctx android.ModuleContext, flags javaBuilderFlags) ([]string, android.Paths) {
|
||||||
d8Flags := j.dexCommonFlags(ctx)
|
d8Flags := j.dexCommonFlags(ctx)
|
||||||
|
|
||||||
d8Flags = append(d8Flags, flags.bootClasspath.FormTurbineClasspath("--lib ")...)
|
d8Flags = append(d8Flags, flags.bootClasspath.FormRepeatedClassPath("--lib ")...)
|
||||||
d8Flags = append(d8Flags, flags.classpath.FormTurbineClasspath("--lib ")...)
|
d8Flags = append(d8Flags, flags.classpath.FormRepeatedClassPath("--lib ")...)
|
||||||
|
|
||||||
var d8Deps android.Paths
|
var d8Deps android.Paths
|
||||||
d8Deps = append(d8Deps, flags.bootClasspath...)
|
d8Deps = append(d8Deps, flags.bootClasspath...)
|
||||||
|
@@ -133,7 +133,7 @@ func kotlinKapt(ctx android.ModuleContext, outputFile android.WritablePath,
|
|||||||
deps = append(deps, srcJars...)
|
deps = append(deps, srcJars...)
|
||||||
deps = append(deps, flags.processorPath...)
|
deps = append(deps, flags.processorPath...)
|
||||||
|
|
||||||
kaptProcessorPath := flags.processorPath.FormTurbineClasspath("-P plugin:org.jetbrains.kotlin.kapt3:apclasspath=")
|
kaptProcessorPath := flags.processorPath.FormRepeatedClassPath("-P plugin:org.jetbrains.kotlin.kapt3:apclasspath=")
|
||||||
|
|
||||||
kaptProcessor := ""
|
kaptProcessor := ""
|
||||||
if flags.processor != "" {
|
if flags.processor != "" {
|
||||||
|
Reference in New Issue
Block a user