summaryrefslogtreecommitdiff
path: root/java/java.go
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-23 01:01:40 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-06-23 01:01:40 +0000
commit33599108f72b782c1f6ffb570dc17fe26cd5a585 (patch)
tree9fb651ef7a956afa6ea517e97200030bafb15054 /java/java.go
parenta833f691fdd8f5c37aca9fb4ab93b2fd7cae4afb (diff)
parent7b905a3f10cbfcee2c54d3bf2345966273bd13fc (diff)
Snap for 7482982 from 7b905a3f10cbfcee2c54d3bf2345966273bd13fc to sc-release
Change-Id: Ica704450df3266527b85ee891963568a669b91e3
Diffstat (limited to 'java/java.go')
-rw-r--r--java/java.go19
1 files changed, 12 insertions, 7 deletions
diff --git a/java/java.go b/java/java.go
index 3b6c9c884..ae8adf277 100644
--- a/java/java.go
+++ b/java/java.go
@@ -1309,7 +1309,7 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
// Get the path of the dex implementation jar from the `deapexer` module.
di := ctx.OtherModuleProvider(deapexerModule, android.DeapexerProvider).(android.DeapexerInfo)
- if dexOutputPath := di.PrebuiltExportPath(j.BaseModuleName(), ".dexjar"); dexOutputPath != nil {
+ if dexOutputPath := di.PrebuiltExportPath(apexRootRelativePathToJavaLib(j.BaseModuleName())); dexOutputPath != nil {
j.dexJarFile = dexOutputPath
// Initialize the hiddenapi structure.
@@ -1429,17 +1429,22 @@ func (j *Import) ShouldSupportSdkVersion(ctx android.BaseModuleContext,
// requiredFilesFromPrebuiltApexForImport returns information about the files that a java_import or
// java_sdk_library_import with the specified base module name requires to be exported from a
// prebuilt_apex/apex_set.
-func requiredFilesFromPrebuiltApexForImport(name string) map[string]string {
- // Add the dex implementation jar to the set of exported files. The path here must match the
- // path of the file in the APEX created by apexFileForJavaModule(...).
- return map[string]string{
- name + "{.dexjar}": filepath.Join("javalib", name+".jar"),
+func requiredFilesFromPrebuiltApexForImport(name string) []string {
+ // Add the dex implementation jar to the set of exported files.
+ return []string{
+ apexRootRelativePathToJavaLib(name),
}
}
+// apexRootRelativePathToJavaLib returns the path, relative to the root of the apex's contents, for
+// the java library with the specified name.
+func apexRootRelativePathToJavaLib(name string) string {
+ return filepath.Join("javalib", name+".jar")
+}
+
var _ android.RequiredFilesFromPrebuiltApex = (*Import)(nil)
-func (j *Import) RequiredFilesFromPrebuiltApex(ctx android.BaseModuleContext) map[string]string {
+func (j *Import) RequiredFilesFromPrebuiltApex(_ android.BaseModuleContext) []string {
name := j.BaseModuleName()
return requiredFilesFromPrebuiltApexForImport(name)
}