summaryrefslogtreecommitdiff
path: root/java/androidmk.go
diff options
context:
space:
mode:
author Jaewoong Jung <jungjw@google.com> 2019-04-15 09:48:31 -0700
committer Jaewoong Jung <jungjw@google.com> 2019-05-01 10:06:47 -0700
commitccbb3936513bddf95214f808a2b51fda24a205e2 (patch)
treeabe1dd0c47831e57511b4cf07c1b7bf0255a55f4 /java/androidmk.go
parent23803f936554103047bafe5ff5d4999e49aa940e (diff)
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
Diffstat (limited to 'java/androidmk.go')
-rw-r--r--java/androidmk.go26
1 files changed, 26 insertions, 0 deletions
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 {