hi.
I have a library which is used by many applications in my company.
This library basically handles commercials, backend comm and licensing.
basically it supportd 3 buildTypes: release, debug and staging which is
like debug only with buildConfigField that states it's staging build.
the problems begins with flavors, the library doesn't really have flavors,
but it's configurations (analytic ids, base license string, server
addresses etc...) is based on the flavor of the application that uses it.
Till not we used an ant custom task to take configuration from the master
project and create a resource under /res/raw. in Gradle we wanted to make
it better.
what i tried to do is to programatically create falvors for by library
project based on the ones from the app using in my library project:
rootProject.android.applicationVariants.all { variant ->
android.productFlavors.create("mylib${variant.name}")
}
the variants are not being defined :-( if i understand correclty it's
because when i'm calling applicationVariants.all the variants for the whole
application have been defined already and so where their dependencies.
Is there a way to do that ? since the android plugin does not do that out
of the box ?
what i want eventually is the ability to define BuildConfig or a res file
per APPLICATION flavor in my LIBRARY project.
I have ugly hack even on gradle to do that, but i want a normal way.
If you ask why not use just files under the flavor name in the main app
project i'll answer it's a bad way to save configuration for several
flavors, better have it all in one file visible to all then several
scattered across several libraries.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.