I would ask why you even need to do this, but I'm afraid of the answer.
you should be able to do something like:
for (int i = 0 ...) {
def flavor = android.productFlavors.create("flavor$i")
flavor.packageName = ...
flavor.versionCode = ...
}
On Wed, Feb 19, 2014 at 10:49 PM, 杨辉 <[email protected]> wrote:
> normal:
> android {
> ...
>
> defaultConfig {
> minSdkVersion 8
> versionCode 10
> }
>
> productFlavors {
> flavor1 {
> packageName "com.example.flavor1"
> versionCode 20
> }
>
> flavor2 {
> packageName "com.example.flavor2"
> minSdkVersion 14
> }
> }
> }
>
> what i want:
> android {
> ...
>
> defaultConfig {
> minSdkVersion 8
> versionCode 10
> }
>
> productFlavors {
> for(int i = 0; i<10; i ++){
> flavor+i {
> packageName "com.example.flavor"+i
> versionCode 20
> }
> }
> }
> }
>
> --
> 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/groups/opt_out.
>
--
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com
Please do not send me questions directly. Thanks!
--
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/groups/opt_out.