Merge "Ensure sscp jars get copied to $OUT/soong/system_server_dexjars" into main am: 9d4ad66a93 am: a3c8609972

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2923733

Change-Id: I2116caee0a2778574bf49d5f521feda6e4c99693
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Spandan Das
2024-01-25 03:01:26 +00:00
committed by Automerger Merge Worker
5 changed files with 105 additions and 47 deletions

View File

@@ -1627,6 +1627,9 @@ func (j *Module) compile(ctx android.ModuleContext, extraSrcJars, extraClasspath
// Dexpreopting
j.dexpreopt(ctx, dexOutputFile)
if !j.IsHideFromMake() {
dexpreopt.CopySystemServerJarsToPredefinedLocations(ctx, j.Name(), dexOutputFile)
}
outputFile = dexOutputFile
} else {

View File

@@ -274,6 +274,8 @@ func (d *Dexpreopter) DexpreoptPrebuiltApexSystemServerJars(ctx android.ModuleCo
// generate the rules for creating the .odex and .vdex files for this system server jar
dexJarFile := di.PrebuiltExportPath(ApexRootRelativePathToJavaLib(libraryName))
d.dexpreopt(ctx, dexJarFile)
dexpreopt.CopySystemServerJarsToPredefinedLocations(ctx, libraryName, dexJarFile)
}
func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.WritablePath) {
@@ -370,7 +372,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Wr
// Full dexpreopt config, used to create dexpreopt build rules.
dexpreoptConfig := &dexpreopt.ModuleConfig{
Name: moduleName(ctx),
Name: dexJarStem, // use dexJarStem as the name of the library so that this function can be called from an apex.
DexLocation: dexLocation,
BuildPath: android.PathForModuleOut(ctx, "dexpreopt", dexJarStem, moduleName(ctx)+".jar").OutputPath,
DexPath: dexJarFile,