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

Commit 8c1ae8f2 authored by Trevor Radcliffe's avatar Trevor Radcliffe Committed by Gerrit Code Review
Browse files

Merge "Ignore obsolete lines when converting makefiles"

parents 1eda2bd9 93295f27
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -639,6 +639,12 @@ func prebuiltModulePath(ctx variableAssignmentContext) error {
	if len(val.Variables) == 1 && varLiteralName(val.Variables[0]) != "" && len(val.Strings) == 2 && val.Strings[0] == "" {
		fixed = val.Strings[1]
		varname = val.Variables[0].Name.Strings[0]
		// TARGET_OUT_OPTIONAL_EXECUTABLES puts the artifact in xbin, which is
		// deprecated. TARGET_OUT_DATA_APPS install location will be handled
		// automatically by Soong
		if varname == "TARGET_OUT_OPTIONAL_EXECUTABLES" || varname == "TARGET_OUT_DATA_APPS" {
			return nil
		}
	} else if len(val.Variables) == 2 && varLiteralName(val.Variables[0]) == "PRODUCT_OUT" && varLiteralName(val.Variables[1]) == "TARGET_COPY_OUT_VENDOR" &&
		len(val.Strings) == 3 && val.Strings[0] == "" && val.Strings[1] == "/" {
		fixed = val.Strings[2]
+17 −1
Original line number Diff line number Diff line
@@ -1516,7 +1516,23 @@ android_app {
    ],
}
`,
	},
	}, {
		desc: "Obsolete LOCAL_MODULE_PATH",
		in: `
include $(CLEAR_VARS)
LOCAL_MODULE := foo
LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
LOCAL_CTS_TEST_PACKAGE := bar
LOCAL_USE_AAPT2 := blah
include $(BUILD_PACKAGE)
`,
		expected: `
android_app {
  name: "foo",

}
`},
}

func TestEndToEnd(t *testing.T) {