Merge "Add option to override defaultManifestVersion"
This commit is contained in:
@@ -4130,6 +4130,41 @@ func TestApexName(t *testing.T) {
|
|||||||
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
|
ensureNotContains(t, androidMk, "LOCAL_MODULE := mylib.com.android.myapex\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestOverrideApexManifestDefaultVersion(t *testing.T) {
|
||||||
|
ctx := testApex(t, `
|
||||||
|
apex {
|
||||||
|
name: "myapex",
|
||||||
|
key: "myapex.key",
|
||||||
|
apex_name: "com.android.myapex",
|
||||||
|
native_shared_libs: ["mylib"],
|
||||||
|
updatable: false,
|
||||||
|
}
|
||||||
|
|
||||||
|
apex_key {
|
||||||
|
name: "myapex.key",
|
||||||
|
public_key: "testkey.avbpubkey",
|
||||||
|
private_key: "testkey.pem",
|
||||||
|
}
|
||||||
|
|
||||||
|
cc_library {
|
||||||
|
name: "mylib",
|
||||||
|
srcs: ["mylib.cpp"],
|
||||||
|
system_shared_libs: [],
|
||||||
|
stl: "none",
|
||||||
|
apex_available: [
|
||||||
|
"//apex_available:platform",
|
||||||
|
"myapex",
|
||||||
|
],
|
||||||
|
}
|
||||||
|
`, android.FixtureMergeEnv(map[string]string{
|
||||||
|
"OVERRIDE_APEX_MANIFEST_DEFAULT_VERSION": "1234",
|
||||||
|
}))
|
||||||
|
|
||||||
|
module := ctx.ModuleForTests("myapex", "android_common_com.android.myapex_image")
|
||||||
|
apexManifestRule := module.Rule("apexManifestRule")
|
||||||
|
ensureContains(t, apexManifestRule.Args["default_version"], "1234")
|
||||||
|
}
|
||||||
|
|
||||||
func TestCompileMultilibProp(t *testing.T) {
|
func TestCompileMultilibProp(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
compileMultiLibProp string
|
compileMultiLibProp string
|
||||||
|
@@ -236,6 +236,10 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
manifestJsonFullOut := android.PathForModuleOut(ctx, "apex_manifest_full.json")
|
manifestJsonFullOut := android.PathForModuleOut(ctx, "apex_manifest_full.json")
|
||||||
|
defaultVersion := android.DefaultUpdatableModuleVersion
|
||||||
|
if override := ctx.Config().Getenv("OVERRIDE_APEX_MANIFEST_DEFAULT_VERSION"); override != "" {
|
||||||
|
defaultVersion = override
|
||||||
|
}
|
||||||
ctx.Build(pctx, android.BuildParams{
|
ctx.Build(pctx, android.BuildParams{
|
||||||
Rule: apexManifestRule,
|
Rule: apexManifestRule,
|
||||||
Input: src,
|
Input: src,
|
||||||
@@ -243,7 +247,7 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
|
|||||||
Args: map[string]string{
|
Args: map[string]string{
|
||||||
"provideNativeLibs": strings.Join(provideNativeLibs, " "),
|
"provideNativeLibs": strings.Join(provideNativeLibs, " "),
|
||||||
"requireNativeLibs": strings.Join(requireNativeLibs, " "),
|
"requireNativeLibs": strings.Join(requireNativeLibs, " "),
|
||||||
"default_version": android.DefaultUpdatableModuleVersion,
|
"default_version": defaultVersion,
|
||||||
"opt": strings.Join(optCommands, " "),
|
"opt": strings.Join(optCommands, " "),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user