Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 659
Distwo Avatar asked Oct 01 '15 23:10

Distwo


People also ask

What is the purpose of gradle build system?

It is popular for its ability to build automation in languages like Java, Scala, Android, C/C++, and Groovy. The tool supports groovy based Domain Specific Language over XML. Gradle provides building, testing, and deploying software on several platforms. The tool is popular for building any software and large projects.

What's the purpose of gradle build system in developing Android application?

Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.

How many build gradle file is there in one Android project?

gradle files in an Android Studio project?


1 Answers

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

like image 142
skoperst Avatar answered Oct 04 '22 06:10

skoperst