aboutsummaryrefslogtreecommitdiffstats
path: root/apex/apex.go
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2020-06-01 21:39:15 +0900
committerAnton Hansson <hansson@google.com>2020-06-04 10:28:44 +0100
commit2cd081cf06c552a562aabae25b7cc17f8242d22f (patch)
treedc03c4e9e58a17b4aaf1e6bee74c75de97c60cea /apex/apex.go
parent8383972ec0a4c2cc5129c4b92cfb8dbe79766987 (diff)
downloadbuild_soong-2cd081cf06c552a562aabae25b7cc17f8242d22f.tar.gz
build_soong-2cd081cf06c552a562aabae25b7cc17f8242d22f.tar.bz2
build_soong-2cd081cf06c552a562aabae25b7cc17f8242d22f.zip
dex_import can be added to apex
Bug:157886942 Test: m Change-Id: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f Merged-In: Ida6f7bb784efe74cc1fa0e8d370eaee803f08b0f
Diffstat (limited to 'apex/apex.go')
-rw-r--r--apex/apex.go18
1 files changed, 6 insertions, 12 deletions
diff --git a/apex/apex.go b/apex/apex.go
index ba1c1d27..b4419908 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -1670,7 +1670,8 @@ func apexFileForShBinary(ctx android.BaseModuleContext, sh *android.ShBinary) ap
}
type javaDependency interface {
- java.Dependency
+ DexJar() android.Path
+ JacocoReportClassesFile() android.Path
Stem() string
}
@@ -1954,23 +1955,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: