On Sat, Nov 15, 2014, at 12:34, Daniele Segato wrote:
> Meaning theres no way to do what I want yet?
If by "what I want" you mean "obtain the 'current' flavor", then no,
there is no way to do what you want, other than by iterating yourself
over build variants.
The only time there is a "current" anything is inside a task. Tasks are
things executed when we actually do the build. Stuff like productFlavors
{} and buildTypes{} are more along the lines of data structures, where
any Groovy code is executed when the script is read in.
Now, you can certainly define your own tasks, and those tasks can be
specific per build variant. You can set up those tasks to depend upon
some other task, and (presumably) you can configure other built-in tasks
to depend upon yours. Whether you can affect buildConfigField this way
and accomplish your aims, I cannot say. And how well this will hold up
over time, as Gradle for Android evolves, I cannot say.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy
_The Busy Coder's Guide to Android Development_ Version 6.1: Wear?
There!
--
You received this message because you are subscribed to the Google Groups
"adt-dev" 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.