diff --git a/dexpreopt/config.go b/dexpreopt/config.go index 02f112074..26ff5baab 100644 --- a/dexpreopt/config.go +++ b/dexpreopt/config.go @@ -115,7 +115,7 @@ type ModuleConfig struct { DexLocation string // dex location on device BuildPath android.OutputPath DexPath android.Path - ManifestPath android.Path + ManifestPath android.OptionalPath UncompressedDex bool HasApkLibraries bool PreoptFlags []string @@ -291,7 +291,7 @@ func ParseModuleConfig(ctx android.PathContext, data []byte) (*ModuleConfig, err // Construct paths that require a PathContext. config.ModuleConfig.BuildPath = constructPath(ctx, config.BuildPath).(android.OutputPath) config.ModuleConfig.DexPath = constructPath(ctx, config.DexPath) - config.ModuleConfig.ManifestPath = constructPath(ctx, config.ManifestPath) + config.ModuleConfig.ManifestPath = android.OptionalPathForPath(constructPath(ctx, config.ManifestPath)) config.ModuleConfig.ProfileClassListing = android.OptionalPathForPath(constructPath(ctx, config.ProfileClassListing)) config.ModuleConfig.EnforceUsesLibrariesStatusFile = constructPath(ctx, config.EnforceUsesLibrariesStatusFile) config.ModuleConfig.ClassLoaderContexts = fromJsonClassLoaderContext(ctx, config.ClassLoaderContexts) diff --git a/dexpreopt/dexpreopt.go b/dexpreopt/dexpreopt.go index 81a63b061..dc17c0a43 100644 --- a/dexpreopt/dexpreopt.go +++ b/dexpreopt/dexpreopt.go @@ -276,9 +276,9 @@ func dexpreoptCommand(ctx android.PathContext, globalSoong *GlobalSoongConfig, g // no time/space is wasted on AOT-compiling modules that will fail CLC check on device. var manifestOrApk android.Path - if module.ManifestPath != nil { + if module.ManifestPath.Valid() { // Ok, there is an XML manifest. - manifestOrApk = module.ManifestPath + manifestOrApk = module.ManifestPath.Path() } else if filepath.Ext(base) == ".apk" { // Ok, there is is an APK with the manifest inside. manifestOrApk = module.DexPath diff --git a/java/dexpreopt.go b/java/dexpreopt.go index b4cf012af..3571590db 100644 --- a/java/dexpreopt.go +++ b/java/dexpreopt.go @@ -221,7 +221,7 @@ func (d *dexpreopter) dexpreopt(ctx android.ModuleContext, dexJarFile android.Wr DexLocation: dexLocation, BuildPath: android.PathForModuleOut(ctx, "dexpreopt", ctx.ModuleName()+".jar").OutputPath, DexPath: dexJarFile, - ManifestPath: d.manifestFile, + ManifestPath: android.OptionalPathForPath(d.manifestFile), UncompressedDex: d.uncompressedDex, HasApkLibraries: false, PreoptFlags: nil,