Merge "Fix host path for dexpreopted system server modules defined in Make."

This commit is contained in:
Ulyana Trafimovich
2020-04-28 08:19:34 +00:00
committed by Gerrit Code Review
2 changed files with 14 additions and 1 deletions

View File

@@ -47,6 +47,8 @@ import (
const SystemPartition = "/system/"
const SystemOtherPartition = "/system_other/"
var DexpreoptRunningInSoong = false
// GenerateDexpreoptRule generates a set of commands that will preopt a module based on a GlobalConfig and a
// ModuleConfig. The produced files and their install locations will be available through rule.Installs().
func GenerateDexpreoptRule(ctx android.PathContext, globalSoong *GlobalSoongConfig,
@@ -589,7 +591,14 @@ func NonUpdatableSystemServerJars(ctx android.PathContext, global *GlobalConfig)
// at that time (Soong processes the jars in dependency order, which may be different from the
// the system server classpath order).
func SystemServerDexJarHostPath(ctx android.PathContext, jar string) android.OutputPath {
if DexpreoptRunningInSoong {
// Soong module, just use the default output directory $OUT/soong.
return android.PathForOutput(ctx, "system_server_dexjars", jar+".jar")
} else {
// Make module, default output directory is $OUT (passed via the "null config" created
// by dexpreopt_gen). Append Soong subdirectory to match Soong module paths.
return android.PathForOutput(ctx, "soong", "system_server_dexjars", jar+".jar")
}
}
func contains(l []string, s string) bool {

View File

@@ -62,6 +62,10 @@ type DexpreoptProperties struct {
}
}
func init() {
dexpreopt.DexpreoptRunningInSoong = true
}
func (d *dexpreopter) dexpreoptDisabled(ctx android.BaseModuleContext) bool {
global := dexpreopt.GetGlobalConfig(ctx)