Fix missing bootclasspath error in java compiles

If a java library only links against the same jar as bootclasspath,
the jar was being added to classpath and not bootclasspath, leaving
bootclasspath blank and using the default bootclasspath.  Reverse
the order so that bootclasspath takes effect.

Change-Id: Ib9fbf01897314a57228013d4aef52606390b0aca
This commit is contained in:
Colin Cross
2015-04-08 11:23:01 -07:00
parent fce532760f
commit 6cbb127564

View File

@@ -162,14 +162,14 @@ func (j *javaBase) collectDeps(ctx common.AndroidModuleContext) (classpath []str
ctx.VisitDirectDeps(func(module blueprint.Module) {
otherName := ctx.OtherModuleName(module)
if javaDep, ok := module.(JavaDependency); ok {
if inList(otherName, j.properties.Java_libs) {
if otherName == j.BootClasspath(ctx) {
bootClasspath = javaDep.ClasspathFile()
} else if inList(otherName, j.properties.Java_libs) {
classpath = append(classpath, javaDep.ClasspathFile())
} else if inList(otherName, j.properties.Java_static_libs) {
classpath = append(classpath, javaDep.ClasspathFile())
classJarSpecs = append(classJarSpecs, javaDep.ClassJarSpecs()...)
resourceJarSpecs = append(resourceJarSpecs, javaDep.ResourceJarSpecs()...)
} else if otherName == j.BootClasspath(ctx) {
bootClasspath = javaDep.ClasspathFile()
} else {
panic(fmt.Errorf("unknown dependency %q for %q", otherName, ctx.ModuleName()))
}