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

Commit f7542544 authored by Jeff Gaston's avatar Jeff Gaston
Browse files

Remove unused property

Bug: 72552085
Test: androidmk prebuilts/sdk/current/support/Android.mk \
      | grep LOCAL_UNINSTALLABLE_MODULE && echo failed

Change-Id: Idcdd571812594599267985dfef2cc2fc6efbb5ba
parent 0c74ad93
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -130,6 +130,9 @@ func rewriteIncorrectAndroidmkPrebuilts(tree *parser.File) error {
		case ".aar":
			renameProperty(mod, "srcs", "aars")
			mod.Type = "android_library_import"

			// An android_library_import doesn't get installed, so setting "installable = false" isn't supported
			removeProperty(mod, "installable")
		}
	}

@@ -195,3 +198,13 @@ func renameProperty(mod *parser.Module, from, to string) {
		}
	}
}

func removeProperty(mod *parser.Module, propertyName string) {
	newList := make([]*parser.Property, 0, len(mod.Properties))
	for _, prop := range mod.Properties {
		if prop.Name != propertyName {
			newList = append(newList, prop)
		}
	}
	mod.Properties = newList
}