peteratt / MultiFlavoredAndroidLibs

6 stars 2 forks source link

A more complex example #2

Open baracudda opened 8 years ago

baracudda commented 8 years ago

When dealing with flavors inside libraries, sub-libraries, and using one library vs another one, things in Gradle get pretty complex fast. Struggled with it for several days until we chanced upon your example code and used it to expand it to suit our needs. Figured a pull request to show you what we came up with that worked is "thank you" for inspiring us to reach new heights. :)

Basically, there is two flavors, "dev" and "prod" which will load up MyLib using those flavors which will then either load up SubLib1 or SubLib2, depending on the flavor. Two more flavors were added to mimic an application where the app is basically a shell and a library contains most of the app code, named AppAsLib here in the example. So "applibdev" and "applibprod" will load up AppLib which loads MyLib and then SubLib1 or SubLib2 depending on the dev/prod flavor.