Android native library that is compiled with AOSP



Hi, I’m very new to circleci, and previously had been using Jenkins on a local server for my CI needs.

I would like to know how to go about setting up a CI environment for an Android project that has a native shared library that has to be compiled against AOSP (100+GB source), and also has an apk on top.

The AOSP is only compiled once, after that, changes to my app take but a few seconds to compile.

I was thinking about setting up a google cloud compute VM, checkout and build AOSP there and then sleep until CircleCI wakes it up for a build.

My doubts: Is CCI able to start the VM on demand and have it build the code, then stop after the job is done?

Thanks for any tip!


You can do this, how long does the compile step take? The max timeout is about two hours on CircleCI.


Compiling my project takes but a few seconds, so I would not expect the timeout to be an issue.

If it had to re-compile AOSP from source every single time a build was triggered than it would be a problem… compiling it on the Google Cloud VM (8vCPUs, 30GB RAM) took close to 70 minutes.

I was also thinking about a containerized solution, with the container mapping the compiled AOSP root folder from either an NFS partition somewhere or some other form of cloud storage.

I am somehow intrigued with the idea of having a lean build env in which I only have my cross compilation toolchain and the shared libs my project links against, and therefore I would not need to have this elephant (AOSP source is close to 120GB) in the room. But this cross compilation stuff is all a bit of rocket science to me.

closed #4