Search code examples
androidmakefileandroid-sourceandroid-build

Where is a good AOSP Makefile to put PRODUCT_PACKAGES+=mytool


I'm working with an internal tool for a few users building in AOSP tree. To enable the build of this tool it must be added to PRODUCT_PACKAGES variable somewhere in the make-system.

PRODUCT_PACKAGES+=mytool

Upto now I have maintained this as uncommitted changes to /build/make/target/product/base_system.mk I could of course fork this module and maintain my patch or maintain it as a diff and patch it when a new workspace is created.

The project now needs to be shared with a handful of coworkers, so this is a good opportunity to make it less hacky and more maintainable as a forked module requires constant merges of upstream patches.

The project only maintain one git repo for manifest and one for the tool itself.

How could I add this assignment of to a Makefile without having to maintain it as a shell script or a forked version of one of the android gits?


Solution

  • You will have to add mytool to the device configuration in device/<vendor>/<device>/device.mk.

    Even if you happen to find a way to make it work from within the mytool repository you probably shouldn't, because it is the job of the integrator to add modules to the device. He can hardly keep track if packages are not collected at a single point and I can think of even more problems if the integration is spread over many repositories, potentially each with an own set of access rights.

    A solution I use when I want to share an early version without the hassle of integration is providing it in form of local repo manifest which combines the mytool repository together with a patched device/<vendor>/<device> repository.