diff options
| author | 2023-12-19 18:08:19 +0000 | |
|---|---|---|
| committer | 2023-12-19 18:08:19 +0000 | |
| commit | 349ef8750509e0eb3fb026df2e481f970652b069 (patch) | |
| tree | 239e095859bc81b166e3f12fad2867199c4edc31 /java/java.go | |
| parent | 2fd47835841b200d8eea0679b9749b6d71ab5eaa (diff) | |
| parent | fae468ef14fa7fd902c8e004dbd55a3e79b8a30f (diff) | |
Merge changes I3323d993,I01cea895 into main
* changes:
Move validation from FindDeapexerProviderForModule to rdeps
Move dexpreopt processing from java_*_import to prebuilt_apex
Diffstat (limited to 'java/java.go')
| -rw-r--r-- | java/java.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/java/java.go b/java/java.go index 630318e6d..51e8c344c 100644 --- a/java/java.go +++ b/java/java.go @@ -2100,6 +2100,7 @@ type Import struct { // output file containing classes.dex and resources dexJarFile OptionalDexJarPath + dexJarFileErr error dexJarInstallFile android.Path combinedClasspathFile android.Path @@ -2250,9 +2251,12 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) { ai, _ := android.ModuleProvider(ctx, android.ApexInfoProvider) if ai.ForPrebuiltApex { // Get the path of the dex implementation jar from the `deapexer` module. - di := android.FindDeapexerProviderForModule(ctx) - if di == nil { - return // An error has been reported by FindDeapexerProviderForModule. + di, err := android.FindDeapexerProviderForModule(ctx) + if err != nil { + // An error was found, possibly due to multiple apexes in the tree that export this library + // Defer the error till a client tries to call DexJarBuildPath + j.dexJarFileErr = err + return } dexJarFileApexRootRelative := apexRootRelativePathToJavaLib(j.BaseModuleName()) if dexOutputPath := di.PrebuiltExportPath(dexJarFileApexRootRelative); dexOutputPath != nil { @@ -2375,6 +2379,9 @@ func (j *Import) ImplementationAndResourcesJars() android.Paths { } func (j *Import) DexJarBuildPath() OptionalDexJarPath { + if j.dexJarFileErr != nil { + panic(j.dexJarFileErr.Error()) + } return j.dexJarFile } |