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

Commit bc506555 authored by Jiyong Park's avatar Jiyong Park Committed by android-build-merger
Browse files

Don't emit make rules for APEX files for non-installable APEX am: 94427265

am: 03fe198a

Change-Id: I879d3630613f1605f129b6aa223bebfad69f0052
parents 5db76340 03fe198a
Loading
Loading
Loading
Loading
+85 −75
Original line number Diff line number Diff line
@@ -954,20 +954,16 @@ func (a *apexBundle) AndroidMk() android.AndroidMkData {
		}}
}

func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkData {
	return android.AndroidMkData{
		Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
func (a *apexBundle) androidMkForFiles(w io.Writer, name, moduleDir string) []string {
	moduleNames := []string{}
			for _, fi := range a.filesInfo {
				if !android.InList(fi.moduleName, moduleNames) {
					moduleNames = append(moduleNames, fi.moduleName)
				}
			}

	for _, fi := range a.filesInfo {
		if cc, ok := fi.module.(*cc.Module); ok && cc.Properties.HideFromMake {
			continue
		}
		if !android.InList(fi.moduleName, moduleNames) {
			moduleNames = append(moduleNames, fi.moduleName)
		}
		fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
		fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
		fmt.Fprintln(w, "LOCAL_MODULE :=", fi.moduleName)
@@ -982,7 +978,6 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD
		}
		fmt.Fprintln(w, "LOCAL_PREBUILT_MODULE_FILE :=", fi.builtFile.String())
		fmt.Fprintln(w, "LOCAL_MODULE_CLASS :=", fi.class.NameInMake())
				fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable())
		if fi.module != nil {
			archStr := fi.module.Target().Arch.ArchType.String()
			host := false
@@ -1033,12 +1028,25 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD
			fmt.Fprintln(w, "include $(BUILD_PREBUILT)")
		}
	}
	return moduleNames
}

func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkData {
	return android.AndroidMkData{
		Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
			moduleNames := []string{}
			if a.installable() {
				a.androidMkForFiles(w, name, moduleDir)
			}

			if a.flattened && apexType.image() {
				// Only image APEXes can be flattened.
				fmt.Fprintln(w, "\ninclude $(CLEAR_VARS)")
				fmt.Fprintln(w, "LOCAL_PATH :=", moduleDir)
				fmt.Fprintln(w, "LOCAL_MODULE :=", name)
				if len(moduleNames) > 0 {
					fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", strings.Join(moduleNames, " "))
				}
				fmt.Fprintln(w, "include $(BUILD_PHONY_PACKAGE)")
			} else {
				// zip-apex is the less common type so have the name refer to the image-apex
@@ -1055,7 +1063,9 @@ func (a *apexBundle) androidMkForType(apexType apexPackaging) android.AndroidMkD
				fmt.Fprintln(w, "LOCAL_MODULE_STEM :=", name+apexType.suffix())
				fmt.Fprintln(w, "LOCAL_UNINSTALLABLE_MODULE :=", !a.installable())
				fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES :=", String(a.properties.Key))
				if len(moduleNames) > 0 {
					fmt.Fprintln(w, "LOCAL_REQUIRED_MODULES +=", strings.Join(moduleNames, " "))
				}
				fmt.Fprintln(w, "include $(BUILD_PREBUILT)")

				if apexType == imageApex {