android - It is possible to get a .aar with a Product flavor -
i work on big project @ work, have been herited 3 months ago. @ moment project structure :
- engine : library entire code (all java classes) extern libraries
- app : android project wrapper have 2 declinaisons-flavor of app (different name , icon commercial purpose). engine lib integrated app.
additionnaly, build engine .aar 1 client use library without app wrapper.
my big problem : last developepr of project dont know gradle , android structure, strange res added twice in engine , app/ build script / extern lib added twice...
so, before work on new major version, want refator build system , simplify ! in best world, want delete lib project, add engine code app, have 1 project app , use power of flavors managing specifics parts.
if have flavors :
- one
- two
- lib
it possible use flavor "lib" .aar ?
if have solution simplify or resolve problem, im over. in advance :)
having, has described it, single application module outputs both .aar , .apk not possible afaik, module has library or application, not both. (i.e. in build.gradle : apply plugin: 'com.android.application'
or 'com.android.library'
).
my guess here (android studio 1.5.1) :
- a single android studio project,
- two modules, 1 library module , 1 application module (file -> new... -> new module... -> 1 "android library" , 1 "phone or tablet module")
- in app module, 2 flavors branding.
- integrate library module app module dependency (in app
build.graddle
dependencies section :compile project(path : ':yourlibrarymodule')
)
your ressources can either stored either in library (usable in lib , app without duplication), in app in main flavor (usable in 2 flavors without duplication) or in 2 flavors.
therefore, can produce .aar
building library module, , 2 .apk
building app module.
Comments
Post a Comment