Merge "Update transitive lib propagation" into main
This commit is contained in:
17
java/base.go
17
java/base.go
@@ -1946,19 +1946,22 @@ func (j *providesTransitiveHeaderJars) collectTransitiveHeaderJars(ctx android.M
|
|||||||
}
|
}
|
||||||
|
|
||||||
dep := ctx.OtherModuleProvider(module, JavaInfoProvider).(JavaInfo)
|
dep := ctx.OtherModuleProvider(module, JavaInfoProvider).(JavaInfo)
|
||||||
if dep.TransitiveLibsHeaderJars != nil {
|
|
||||||
transitiveLibs = append(transitiveLibs, dep.TransitiveLibsHeaderJars)
|
|
||||||
}
|
|
||||||
if dep.TransitiveStaticLibsHeaderJars != nil {
|
|
||||||
transitiveStaticLibs = append(transitiveStaticLibs, dep.TransitiveStaticLibsHeaderJars)
|
|
||||||
}
|
|
||||||
|
|
||||||
tag := ctx.OtherModuleDependencyTag(module)
|
tag := ctx.OtherModuleDependencyTag(module)
|
||||||
_, isUsesLibDep := tag.(usesLibraryDependencyTag)
|
_, isUsesLibDep := tag.(usesLibraryDependencyTag)
|
||||||
if tag == libTag || tag == r8LibraryJarTag || isUsesLibDep {
|
if tag == libTag || tag == r8LibraryJarTag || isUsesLibDep {
|
||||||
directLibs = append(directLibs, dep.HeaderJars...)
|
directLibs = append(directLibs, dep.HeaderJars...)
|
||||||
} else if tag == staticLibTag {
|
} else if tag == staticLibTag {
|
||||||
directStaticLibs = append(directStaticLibs, dep.HeaderJars...)
|
directStaticLibs = append(directStaticLibs, dep.HeaderJars...)
|
||||||
|
} else {
|
||||||
|
// Don't propagate transitive libs for other kinds of dependencies.
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if dep.TransitiveLibsHeaderJars != nil {
|
||||||
|
transitiveLibs = append(transitiveLibs, dep.TransitiveLibsHeaderJars)
|
||||||
|
}
|
||||||
|
if dep.TransitiveStaticLibsHeaderJars != nil {
|
||||||
|
transitiveStaticLibs = append(transitiveStaticLibs, dep.TransitiveStaticLibsHeaderJars)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
j.transitiveLibsHeaderJars = android.NewDepSet(android.POSTORDER, directLibs, transitiveLibs)
|
j.transitiveLibsHeaderJars = android.NewDepSet(android.POSTORDER, directLibs, transitiveLibs)
|
||||||
|
Reference in New Issue
Block a user