The Computing Version code in multi-flavor 
setup<https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/tips#TOC-Computing-Version-code-in-multi-flavor-setup>
 tip doesn't 
work for me. Maybe I'm missing something.

I have no flavours explicitly defined, so I guess there is only the one 
default main flavour. Thus, all variants share a single flavour, the 
default one.

This means that a change to the mergedFlavour for *one* variant sets the 
versionName/Code for *all* variants. I cannot set the versionName/Code 
uniquely per buildType.

It is frustrating to not be able to set the versionCode and versionName per 
buildType via the DSL.

Here is a snippet of hacky groovy used to verify that the mergedFlavour is 
indeed shared:

    def mergeFlavours = new ArrayList();
    applicationVariants.all { variant ->
        mergeFlavours.add(variant.mergedFlavor)
    }
    printf mergeFlavours[0] == mergeFlavours[1] ? "same" : "different"

It outputs "same".

On Saturday, February 22, 2014 5:27:47 AM UTC+13, Xavier Ducrohet wrote:
>
> You can do this right now by computing the versionCode. Something similar 
> to the tip described here: 
> https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/tips#TOC-Computing-Version-code-in-multi-flavor-setup
> .
>
>
> On Fri, Feb 21, 2014 at 2:31 AM, <[email protected] <javascript:>> wrote:
>
>> Is there any word on this being added? I would find this quite useful as 
>> well. 
>>
>>
>> On Wednesday, December 11, 2013 2:39:39 PM UTC, Jordan Beck wrote:
>>>
>>> Same issue here. To compound the problem, I'm using buildConfig to add a 
>>> few variables, but Android Studios seems to have a problem with flavors and 
>>> BuildConfig. It can't find the BuildConfig.java file that is clearly there 
>>> and I can build from the command line. Being able to set the versionCode 
>>> and versionName for build types would have saved me two days of work trying 
>>> to work-around this issue.
>>>
>>> On Thursday, May 23, 2013 2:38:31 PM UTC-4, Benjamin Cooley wrote:
>>>>
>>>> I have a requirement that our debug packages and our release packages 
>>>> contain different version codes (well, different suffixes at least). 
>>>> Reading over the documentation, there seems no way to do this, the closest 
>>>> I can come is to make a different flavor for debug/release and just ignore 
>>>> BuildTypes?
>>>>
>>>> Is there a way to make versionCode specific to build type? If not, is 
>>>> it possible to disable build type and only use flavors?
>>>>
>>>> - Ben
>>>>
>>>
>>
>> This e-mail, including attachments, contains confidential and/or 
>> proprietary information, and may be used only by the person or entity to 
>> which it is addressed. The reader is hereby notified that any 
>> dissemination, distribution or copying of this e-mail is prohibited. If you 
>> have received this e-mail in error, please notify the sender by replying to 
>> this message and delete this e-mail immediately.
>>  
>> -- 
>> 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] <javascript:>.
>> 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/d/optout.

Reply via email to