Merge changes I0edb681b,I0ea2327f into main
* changes: Remove internal deapexer module Remove deapex support from java_*_import
This commit is contained in:
39
java/java.go
39
java/java.go
@@ -2818,41 +2818,14 @@ func (j *Import) GenerateAndroidBuildActions(ctx android.ModuleContext) {
|
||||
}
|
||||
|
||||
if ctx.Device() {
|
||||
// If this is a variant created for a prebuilt_apex then use the dex implementation jar
|
||||
// obtained from the associated deapexer module.
|
||||
// Shared libraries deapexed from prebuilt apexes are no longer supported.
|
||||
// Set the dexJarBuildPath to a fake path.
|
||||
// This allows soong analysis pass, but will be an error during ninja execution if there are
|
||||
// any rdeps.
|
||||
ai, _ := android.ModuleProvider(ctx, android.ApexInfoProvider)
|
||||
if ai.ForPrebuiltApex {
|
||||
// Get the path of the dex implementation jar from the `deapexer` module.
|
||||
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
|
||||
j.initHiddenAPIError(err)
|
||||
return
|
||||
}
|
||||
dexJarFileApexRootRelative := ApexRootRelativePathToJavaLib(j.BaseModuleName())
|
||||
if dexOutputPath := di.PrebuiltExportPath(dexJarFileApexRootRelative); dexOutputPath != nil {
|
||||
dexJarFile := makeDexJarPathFromPath(dexOutputPath)
|
||||
j.dexJarFile = dexJarFile
|
||||
installPath := android.PathForModuleInPartitionInstall(ctx, "apex", ai.ApexVariationName, ApexRootRelativePathToJavaLib(j.BaseModuleName()))
|
||||
j.dexJarInstallFile = installPath
|
||||
|
||||
j.dexpreopter.installPath = j.dexpreopter.getInstallPath(ctx, android.RemoveOptionalPrebuiltPrefix(ctx.ModuleName()), installPath)
|
||||
setUncompressDex(ctx, &j.dexpreopter, &j.dexer)
|
||||
j.dexpreopter.uncompressedDex = *j.dexProperties.Uncompress_dex
|
||||
|
||||
if profilePath := di.PrebuiltExportPath(dexJarFileApexRootRelative + ".prof"); profilePath != nil {
|
||||
j.dexpreopter.inputProfilePathOnHost = profilePath
|
||||
}
|
||||
|
||||
// Initialize the hiddenapi structure.
|
||||
j.initHiddenAPI(ctx, dexJarFile, outputFile, j.dexProperties.Uncompress_dex)
|
||||
} else {
|
||||
// This should never happen as a variant for a prebuilt_apex is only created if the
|
||||
// prebuilt_apex has been configured to export the java library dex file.
|
||||
ctx.ModuleErrorf("internal error: no dex implementation jar available from prebuilt APEX %s", di.ApexModuleName())
|
||||
}
|
||||
j.dexJarFile = makeDexJarPathFromPath(android.PathForModuleInstall(ctx, "intentionally_no_longer_supported"))
|
||||
j.initHiddenAPI(ctx, j.dexJarFile, outputFile, j.dexProperties.Uncompress_dex)
|
||||
} else if Bool(j.dexProperties.Compile_dex) {
|
||||
sdkDep := decodeSdkDep(ctx, android.SdkContext(j))
|
||||
if sdkDep.invalidVersion {
|
||||
|
Reference in New Issue
Block a user