Merge "Fix on-device paths to used libraries in dexpreopt." am: 69bd288409
am: 73759b9a5d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1326319 Change-Id: Iec7143aa2f61c9d5b7b61e8d9510db3a573d794a
This commit is contained in:
committed by
Automerger Merge Worker
commit
12a10b050f
20
java/app.go
20
java/app.go
@@ -1897,16 +1897,22 @@ func (u *usesLibrary) usesLibraryPaths(ctx android.ModuleContext) dexpreopt.Libr
|
||||
ctx.VisitDirectDepsWithTag(usesLibTag, func(m android.Module) {
|
||||
dep := ctx.OtherModuleName(m)
|
||||
if lib, ok := m.(Dependency); ok {
|
||||
if dexJar := lib.DexJarBuildPath(); dexJar != nil {
|
||||
usesLibPaths[dep] = &dexpreopt.LibraryPath{
|
||||
dexJar,
|
||||
// TODO(b/132357300): propagate actual install paths here.
|
||||
filepath.Join("/system/framework", dep+".jar"),
|
||||
}
|
||||
} else {
|
||||
buildPath := lib.DexJarBuildPath()
|
||||
if buildPath == nil {
|
||||
ctx.ModuleErrorf("module %q in uses_libs or optional_uses_libs must"+
|
||||
" produce a dex jar, does it have installable: true?", dep)
|
||||
return
|
||||
}
|
||||
|
||||
var devicePath string
|
||||
installPath := lib.DexJarInstallPath()
|
||||
if installPath == nil {
|
||||
devicePath = filepath.Join("/system/framework", dep+".jar")
|
||||
} else {
|
||||
devicePath = android.InstallPathToOnDevicePath(ctx, installPath.(android.InstallPath))
|
||||
}
|
||||
|
||||
usesLibPaths[dep] = &dexpreopt.LibraryPath{buildPath, devicePath}
|
||||
} else if ctx.Config().AllowMissingDependencies() {
|
||||
ctx.AddMissingDependencies([]string{dep})
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user