Distwo
Distwo

Reputation: 11759

Build gradle system app as part of AOSP build

I have a custom rom based on AOSP and I am working on a system app that is packaged during the rom build just like any other system app.

Is it possible to switch this app to a gradle style app and build that specific app with gradle during the AOSP build? i.e. - Start the gradle build from a makefile?

Upvotes: 17

Views: 5650

Answers (1)

skoperst
skoperst

Reputation: 2309

I didn't find a perfect solution for this. But you can try:

Android.mk:

LOCAL_PATH := $(call my-dir)
$(info $(shell ($(LOCAL_PATH)/gradlew build -p $(LOCAL_PATH)/)) )
$(info $(shell ($(LOCAL_PATH)/finalize.sh $(PRODUCT_OUT))))

finallize.sh:

BASEDIR=$(dirname $0)
PRODUCT_PATH=$1
echo $PRODUCT_PATH
java -Xmx1024m -jar $BASEDIR/../../../out/host/linux-x86/framework/signapk.jar $BASEDIR/../../../build/target/product/security/platform.x509.pem $BASEDIR/../../../build/target/product/security/platform.pk8 $BASEDIR/main/build/outputs/apk/main-normal-release-unsigned.apk $PRODUCT_PATH/system/app/MYAPP.apk

It worked for me

Upvotes: 12

Related Questions