diff --git a/java/androidmk.go b/java/androidmk.go index af91a33d0..32ee7ac95 100644 --- a/java/androidmk.go +++ b/java/androidmk.go @@ -152,30 +152,31 @@ func (app *AndroidApp) AndroidMk() android.AndroidMkData { Include: "$(BUILD_SYSTEM)/soong_app_prebuilt.mk", Extra: []android.AndroidMkExtraFunc{ func(w io.Writer, outputFile android.Path) { - if Bool(app.appProperties.Export_package_resources) { - if app.dexJarFile != nil { - fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", app.dexJarFile.String()) - } - fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", app.exportPackage.String()) - - if app.jacocoReportClassesFile != nil { - fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", app.jacocoReportClassesFile.String()) - } - - if app.Name() == "framework-res" { - fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") - // Make base_rules.mk not put framework-res in a subdirectory called - // framework_res. - fmt.Fprintln(w, "LOCAL_NO_STANDARD_LIBRARIES := true") - } - - if len(app.rroDirs) > 0 { - fmt.Fprintln(w, "LOCAL_SOONG_RRO_DIRS :=", strings.Join(app.rroDirs.Strings(), " ")) - } - fmt.Fprintln(w, "LOCAL_EXPORT_PACKAGE_RESOURCES :=", - Bool(app.appProperties.Export_package_resources)) - fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", app.manifestPath.String()) + fmt.Fprintln(w, "LOCAL_SOONG_RESOURCE_EXPORT_PACKAGE :=", app.exportPackage.String()) + if app.dexJarFile != nil { + fmt.Fprintln(w, "LOCAL_SOONG_DEX_JAR :=", app.dexJarFile.String()) } + if app.jacocoReportClassesFile != nil { + fmt.Fprintln(w, "LOCAL_SOONG_JACOCO_REPORT_CLASSES_JAR :=", app.jacocoReportClassesFile.String()) + } + + if app.Name() == "framework-res" { + fmt.Fprintln(w, "LOCAL_MODULE_PATH := $(TARGET_OUT_JAVA_LIBRARIES)") + // Make base_rules.mk not put framework-res in a subdirectory called + // framework_res. + fmt.Fprintln(w, "LOCAL_NO_STANDARD_LIBRARIES := true") + } + + if len(app.rroDirs) > 0 { + fmt.Fprintln(w, "LOCAL_SOONG_RRO_DIRS :=", strings.Join(app.rroDirs.Strings(), " ")) + } + + if Bool(app.appProperties.Export_package_resources) { + fmt.Fprintln(w, "LOCAL_EXPORT_PACKAGE_RESOURCES := true") + } + + fmt.Fprintln(w, "LOCAL_FULL_MANIFEST_FILE :=", app.manifestPath.String()) + }, }, }