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

Commit e317b15c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Support converting LOCAL_PROTO_JAVA_OUTPUT_PARAMS" into main

parents cf33b025 5418340d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ var rewriteProperties = map[string](func(variableAssignmentContext) error){
	"LOCAL_SANITIZE_DIAG":                  sanitize("diag."),
	"LOCAL_STRIP_MODULE":                   strip(),
	"LOCAL_CFLAGS":                         cflags,
	"LOCAL_PROTO_JAVA_OUTPUT_PARAMS":       protoOutputParams,
	"LOCAL_UNINSTALLABLE_MODULE":           invert("installable"),
	"LOCAL_PROGUARD_ENABLED":               proguardEnabled,
	"LOCAL_MODULE_PATH":                    prebuiltModulePath,
@@ -760,6 +761,13 @@ func cflags(ctx variableAssignmentContext) error {
	return includeVariableNow(bpVariable{"cflags", bpparser.ListType}, ctx)
}

func protoOutputParams(ctx variableAssignmentContext) error {
	// The Soong replacement for LOCAL_PROTO_JAVA_OUTPUT_PARAMS doesn't need ","
	ctx.mkvalue = ctx.mkvalue.Clone()
	ctx.mkvalue.ReplaceLiteral(`, `, ` `)
	return includeVariableNow(bpVariable{"proto.output_params", bpparser.ListType}, ctx)
}

func proguardEnabled(ctx variableAssignmentContext) error {
	val, err := makeVariableToBlueprint(ctx.file, ctx.mkvalue, bpparser.ListType)
	if err != nil {
+20 −0
Original line number Diff line number Diff line
@@ -1725,6 +1725,26 @@ android_test {
	name: "foo",
	test_suites: ["bar"],
}
`,
	},
	{
		desc: "LOCAL_PROTO_JAVA_OUTPUT_PARAMS",
		in: `
include $(CLEAR_VARS)
LOCAL_MODULE := foo
LOCAL_PROTO_JAVA_OUTPUT_PARAMS := enum_style=java, parcelable_messages=true
include $(BUILD_PACKAGE)
		`,
		expected: `
android_app {
	name: "foo",
	proto: {
        output_params: [
            "enum_style=java",
            "parcelable_messages=true",
        ],
    },
}
`,
	},
}