Android Studio / Gradle : force some modules to be built and copied to a directory before building the main app -


i have android studio project made of several sub-projects, android apps. setup this:

project     |---- main app     |---- other app 1     |---- other app 2     |---- other app 3     |---- etc.   

the point "other app" sub-projects need included in main app final apk (they plugins main app can install on-demand when/if user requests them).

so need setup project that:

  • every time "other app x" built apk copied main app's /assets/ directory
  • every time "main app" built, triggers build of "other apps" need building

now, i'm used visual studio, , there can set project dependencies building 1 project triggers build of other projects, , can set post-build command copies generated binary folder quite easily.

with android studio , gradle i'm getting extremely confused.

first of all: if setup project main app depends on other apps doesn't build other apps' apks, compiles sourcecode (which useless in case, need final apk of other apps).

secondly, assuming i've been able generate such apks, can't find place setup post-apk-generation command copy apks directory. i've been reading gradle tasks , "dependson" feature, understand task generates actual apk ("assemble") last 1 in build chain, using dependson no use me, need "whenfinishedrun(mytaskthatcopiestheapks)"

any easy way this? maybe it's because i'm gradle noobie, build system seems extremely convoluted me, i'm thinking of writing external program run mamually accomplish these tasks...

rather operating on apk, gradle dependencies let config aar dependency can issue.

example dependency on aar here - see "amlcurran"


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -