add variant_version property to apexBundle
This property allows modifying the variant version that is put into the APEX manifest. Bug: 285138555 Change-Id: I42b8c0ddad8822a0a329e99ec4ec62f8c3546ee9
This commit is contained in:
@@ -275,6 +275,22 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
||||
|
||||
manifestJsonFullOut := android.PathForModuleOut(ctx, "apex_manifest_full.json")
|
||||
defaultVersion := android.DefaultUpdatableModuleVersion
|
||||
if a.properties.Variant_version != nil {
|
||||
defaultVersionInt, err := strconv.Atoi(defaultVersion)
|
||||
if err != nil {
|
||||
ctx.ModuleErrorf("expected DefaultUpdatableModuleVersion to be an int, but got %s", defaultVersion)
|
||||
}
|
||||
if defaultVersionInt%10 != 0 {
|
||||
ctx.ModuleErrorf("expected DefaultUpdatableModuleVersion to end in a zero, but got %s", defaultVersion)
|
||||
}
|
||||
variantVersion := []rune(*a.properties.Variant_version)
|
||||
if len(variantVersion) != 1 || variantVersion[0] < '0' || variantVersion[0] > '9' {
|
||||
ctx.PropertyErrorf("variant_version", "expected an integer between 0-9; got %s", *a.properties.Variant_version)
|
||||
}
|
||||
defaultVersionRunes := []rune(defaultVersion)
|
||||
defaultVersionRunes[len(defaultVersion)-1] = []rune(variantVersion)[0]
|
||||
defaultVersion = string(defaultVersionRunes)
|
||||
}
|
||||
if override := ctx.Config().Getenv("OVERRIDE_APEX_MANIFEST_DEFAULT_VERSION"); override != "" {
|
||||
defaultVersion = override
|
||||
}
|
||||
|
Reference in New Issue
Block a user