Merge "dex_import can be added to apex"

This commit is contained in:
Treehugger Robot
2020-06-04 05:06:22 +00:00
committed by Gerrit Code Review
3 changed files with 25 additions and 13 deletions

View File

@@ -1650,7 +1650,8 @@ func apexFileForShBinary(ctx android.BaseModuleContext, sh *sh.ShBinary) apexFil
}
type javaDependency interface {
java.Dependency
DexJar() android.Path
JacocoReportClassesFile() android.Path
Stem() string
}
@@ -1977,23 +1978,16 @@ func (a *apexBundle) GenerateAndroidBuildActions(ctx android.ModuleContext) {
ctx.PropertyErrorf("binaries", "%q is neither cc_binary, (embedded) py_binary, (host) blueprint_go_binary, (host) bootstrap_go_binary, nor sh_binary", depName)
}
case javaLibTag:
if javaLib, ok := child.(*java.Library); ok {
af := apexFileForJavaLibrary(ctx, javaLib, javaLib)
if !af.Ok() {
ctx.PropertyErrorf("java_libs", "%q is not configured to be compiled into dex", depName)
} else {
filesInfo = append(filesInfo, af)
return true // track transitive dependencies
}
} else if sdkLib, ok := child.(*java.SdkLibrary); ok {
af := apexFileForJavaLibrary(ctx, sdkLib, sdkLib)
switch child.(type) {
case *java.Library, *java.SdkLibrary, *java.DexImport:
af := apexFileForJavaLibrary(ctx, child.(javaDependency), child.(android.Module))
if !af.Ok() {
ctx.PropertyErrorf("java_libs", "%q is not configured to be compiled into dex", depName)
return false
}
filesInfo = append(filesInfo, af)
return true // track transitive dependencies
} else {
default:
ctx.PropertyErrorf("java_libs", "%q of type %q is not supported", depName, ctx.OtherModuleType(child))
}
case androidAppTag: