From ccbb3936513bddf95214f808a2b51fda24a205e2 Mon Sep 17 00:00:00 2001 From: Jaewoong Jung Date: Mon, 15 Apr 2019 09:48:31 -0700 Subject: Add android_app_import. This is an initial version that handles the most basic cases. Bug: 128610294 Test: app_test.go + prebuilt webview.apk Change-Id: Ic525559aad5612987e50aa75b326b77b23acb716 --- java/androidmk.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'java/androidmk.go') diff --git a/java/androidmk.go b/java/androidmk.go index aa1a81b2a..5491b3eba 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -590,6 +590,32 @@ func (dstubs *Droidstubs) AndroidMk() android.AndroidMkData { } } +func (app *AndroidAppImport) AndroidMk() android.AndroidMkData { + return android.AndroidMkData{ + Class: "APPS", + OutputFile: android.OptionalPathForPath(app.outputFile), + Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", + Extra: []android.AndroidMkExtraFunc{ + func(w io.Writer, outputFile android.Path) { + if Bool(app.properties.Privileged) { + fmt.Fprintln(w, "LOCAL_PRIVILEGED_MODULE := true") + } + if app.certificate != nil { + fmt.Fprintln(w, "LOCAL_CERTIFICATE :=", app.certificate.Pem.String()) + } else { + fmt.Fprintln(w, "LOCAL_CERTIFICATE := PRESIGNED") + } + if len(app.properties.Overrides) > 0 { + fmt.Fprintln(w, "LOCAL_OVERRIDES_PACKAGES :=", strings.Join(app.properties.Overrides, " ")) + } + if len(app.dexpreopter.builtInstalled) > 0 { + fmt.Fprintln(w, "LOCAL_SOONG_BUILT_INSTALLED :=", app.dexpreopter.builtInstalled) + } + }, + }, + } +} + func androidMkWriteTestData(data android.Paths, ret *android.AndroidMkData) { var testFiles []string for _, d := range data { -- cgit v1.2.3-59-g8ed1b