Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Does pipeline for android even work for big projects?

한상진 September 6, 2021

I have an android project which consists of 50 modules. In attempt to automatically do a release build on push, I've established a pipeline with the below scripts.

gradle.properties


#org.gradle.jvmargs=-Xmx4096m -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError
#org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError
#org.gradle.jvmargs=-Xmx1024m -XX:MaxPermSize=1024m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xms512m -Xmx5g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

org.gradle.daemon=true

org.gradle.configureondemand=true

#org.gradle.parallel=true

android.useAndroidX=true

android.enableJetifier=true

kotlin.code.style=official

 

bitbucket-pipelines.yml

image: androidsdk/android-30

options:
size: 2x

pipelines:
default:
- step:
size: 2x
name: Android TestSv Release
caches:
- gradle
script:
- chmod 755 gradlew
- JAVA_OPTS="-Xms512m -Xmx5g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 Fu=IX ISSUE"
- echo "$SIGNING_JKS_FILE" | base64 -d > android-signing-keystore.jks
- ./gradlew assembleSvtestRelease
artifacts:
- A0_Application/**
after-script:
- pipe: atlassian/checkstyle-report:0.2.0

definitions:
services:
docker:
memory: 1024

This works for assembleDebug, but for release, the memory keeps exceeding. I've searched for a day to make this to work for my project, but with no luck. 

The tutorials I've found were just small samples without any consideration about the memory stuff. 


Does the pipeline has the capability to build such multi module project? If so, what should I change for my script?

 

1 answer

0 votes
alr3000 November 4, 2021

There is an answer here: https://community.atlassian.com/t5/Bitbucket-questions/Why-I-can-t-build-android-project-on-Pipelines/qaq-p/1003995

basically, increase the memory:

- step:
size: 2x # Double resources available for this step.

Seemed to work for me, but mine was only intermittently failing.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events