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
diff --git a/java/java.go b/java/java.go
index c604186..448580e 100644
--- a/java/java.go
+++ b/java/java.go
@@ -162,14 +162,14 @@
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()))
}