Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4cba817e authored by Yuntao Xu's avatar Yuntao Xu
Browse files

mk2bp LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG

Added the support to convert the Make boolean variable
LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG as auto_gen_config
and reverse its value in the androidmk tool.

Bug: 216194235
Test: m androidmk
Test: TreeHugger
Change-Id: Ieb51d52df78b9f8d78b36e864fa1e3489faa8c45
parent c01e074f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,8 @@ var rewriteProperties = map[string](func(variableAssignmentContext) error){
	"LOCAL_MODULE_PATH":                    prebuiltModulePath,
	"LOCAL_REPLACE_PREBUILT_APK_INSTALLED": prebuiltPreprocessed,

	"LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG": invert("auto_gen_config"),

	// composite functions
	"LOCAL_MODULE_TAGS": includeVariableIf(bpVariable{"tags", bpparser.ListType}, not(valueDumpEquals("optional"))),

+30 −0
Original line number Diff line number Diff line
@@ -1643,6 +1643,36 @@ android_app {
		"gen_src3",
	],
}
`,
	},
	{
		desc: "LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG is true",
		in: `
include $(CLEAR_VARS)
LOCAL_MODULE := foo
LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG := true
include $(BUILD_PACKAGE)
		`,
		expected: `
android_app {
	name: "foo",
	auto_gen_config: false,
}
`,
	},
	{
		desc: "LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG is false",
		in: `
include $(CLEAR_VARS)
LOCAL_MODULE := foo
LOCAL_DISABLE_AUTO_GENERATE_TEST_CONFIG := false
include $(BUILD_PACKAGE)
		`,
		expected: `
android_app {
	name: "foo",
	auto_gen_config: true,
}
`,
	},
}