This Gradle plugin which sets android.aaptOptions.additionalParameters based on environment variables defined by AOSP build system.
Project link: https://github.com/DroidsOnRoids/android-gradle-aosp-aapt-plugin