Merge "Replace panic with ModuleErrorf" into main
This commit is contained in:
12
java/java.go
12
java/java.go
@@ -316,7 +316,7 @@ type ApexDependency interface {
|
||||
|
||||
// Provides build path and install path to DEX jars.
|
||||
type UsesLibraryDependency interface {
|
||||
DexJarBuildPath() OptionalDexJarPath
|
||||
DexJarBuildPath(ctx android.ModuleErrorfContext) OptionalDexJarPath
|
||||
DexJarInstallPath() android.Path
|
||||
ClassLoaderContexts() dexpreopt.ClassLoaderContextMap
|
||||
}
|
||||
@@ -2013,7 +2013,7 @@ func (al *ApiLibrary) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
})
|
||||
}
|
||||
|
||||
func (al *ApiLibrary) DexJarBuildPath() OptionalDexJarPath {
|
||||
func (al *ApiLibrary) DexJarBuildPath(ctx android.ModuleErrorfContext) OptionalDexJarPath {
|
||||
return al.dexJarFile
|
||||
}
|
||||
|
||||
@@ -2380,9 +2380,9 @@ func (j *Import) ImplementationAndResourcesJars() android.Paths {
|
||||
return android.Paths{j.combinedClasspathFile}
|
||||
}
|
||||
|
||||
func (j *Import) DexJarBuildPath() OptionalDexJarPath {
|
||||
func (j *Import) DexJarBuildPath(ctx android.ModuleErrorfContext) OptionalDexJarPath {
|
||||
if j.dexJarFileErr != nil {
|
||||
panic(j.dexJarFileErr.Error())
|
||||
ctx.ModuleErrorf(j.dexJarFileErr.Error())
|
||||
}
|
||||
return j.dexJarFile
|
||||
}
|
||||
@@ -2633,7 +2633,7 @@ func (j *DexImport) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
}
|
||||
}
|
||||
|
||||
func (j *DexImport) DexJarBuildPath() OptionalDexJarPath {
|
||||
func (j *DexImport) DexJarBuildPath(ctx android.ModuleErrorfContext) OptionalDexJarPath {
|
||||
return j.dexJarFile
|
||||
}
|
||||
|
||||
@@ -2801,7 +2801,7 @@ func addCLCFromDep(ctx android.ModuleContext, depModule android.Module,
|
||||
// from its CLC should be added to the current CLC.
|
||||
if sdkLib != nil {
|
||||
clcMap.AddContext(ctx, dexpreopt.AnySdkVersion, *sdkLib, false,
|
||||
dep.DexJarBuildPath().PathOrNil(), dep.DexJarInstallPath(), dep.ClassLoaderContexts())
|
||||
dep.DexJarBuildPath(ctx).PathOrNil(), dep.DexJarInstallPath(), dep.ClassLoaderContexts())
|
||||
} else {
|
||||
clcMap.AddContextMap(dep.ClassLoaderContexts(), depName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user