Using an Android library with flavors as a dependency?

124 views
Skip to first unread message

Kevin Kovach

unread,
Jun 30, 2014, 9:16:41 AM6/30/14
to maven-androi...@googlegroups.com
I posted this over on the Android Developers group and didn't get a response.  I thought this might be a better/alternative spot for the question.

I have a android library project that I'm building with Gradle that has two flavors. I need to upload this library in both flavors to our local maven repository for use in other projects.  The issue I'm having is that I cannot figure out how these flavors play into the maven group, artifact, version scheme so that I can use them as dependencies in other projects.  Should I just be modifying the version based on the flavor before uploading it?  Or, is there some other way of referencing flavors that I am unaware of?  Thanks.

- Kevin

Malachi de AElfweald

unread,
Jun 30, 2014, 10:51:45 AM6/30/14
to maven-androi...@googlegroups.com
If you are building two different flavors of your library, in theory there is something different about them?

If it is just the version (ie beta / stable) then obviously you'd just change the version.

If it is core functionality, like Google Play vs Amazon support, I'd probably change the artifact id.

As a last resort, if you want groupId/artifactId/version to remain the same, you could change the classifier...



--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Thank you,
Malachi de Ælfweald | Technology Team | Upsight
Mobile: +1 503-307-1597
Skype: malachid69 | Find me on 
LinkedIn

Get the Best Mobile Marketing and Analytics free | Upsight is Hiring!

Check Out Our Blog |  Follow Us @GetUpsight


Kevin Kovach

unread,
Jun 30, 2014, 3:42:38 PM6/30/14
to maven-androi...@googlegroups.com
We have a partner that uses our library with Adobe Air and it appears to have issues with annotations, so I've had to modify a couple classes to not use them. Risking a philosophical debate, I feel strongly about the design with annotations and would rather build an 'air' flavor than not use them just because of Adobe Air.

Anyway, while waiting for more info I found this old thread https://groups.google.com/forum/#!topic/adt-dev/3F-47oCzW0w that seems pretty relevant.

The functionality has to be the same, so I'd rather not change the artifactid. I would probably call it a different version before doing that. It seems like this kind of flavor would most closely resemble a classifier, but I'm not familiar enough with that to know for sure.


On Monday, June 30, 2014 10:51:45 AM UTC-4, Malachi de AElfweald wrote:
If you are building two different flavors of your library, in theory there is something different about them?

If it is just the version (ie beta / stable) then obviously you'd just change the version.

If it is core functionality, like Google Play vs Amazon support, I'd probably change the artifact id.

As a last resort, if you want groupId/artifactId/version to remain the same, you could change the classifier...

On Mon, Jun 30, 2014 at 6:16 AM, Kevin Kovach <kov...@gmail.com> wrote:
I posted this over on the Android Developers group and didn't get a response.  I thought this might be a better/alternative spot for the question.

I have a android library project that I'm building with Gradle that has two flavors. I need to upload this library in both flavors to our local maven repository for use in other projects.  The issue I'm having is that I cannot figure out how these flavors play into the maven group, artifact, version scheme so that I can use them as dependencies in other projects.  Should I just be modifying the version based on the flavor before uploading it?  Or, is there some other way of referencing flavors that I am unaware of?  Thanks.

- Kevin

--
You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-developers+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Manfred Moser

unread,
Jun 30, 2014, 3:50:54 PM6/30/14
to maven-androi...@googlegroups.com
A common example for that is google guice with the no_aop classifier for Android usage. So yeah.. if you can .. make an artifact with a classifier... but just making a new artifact without the annotation is potentially a better/cleaner solution.

It will depend on what you have to change to and how different the artifacts end up.. e.g. if there is a difference in the exposed API .. new artifact..

manfred

Kevin Kovach wrote on 30.06.2014 12:42:

> We have a partner that uses our library with Adobe Air and it appears to have issues with annotations, so I've had to modify a couple classes to not use them. Risking a philosophical debate, I feel strongly about the design with annotations and would rather build an 'air' flavor than not use them just because of Adobe Air.
>
>
> Anyway, while waiting for more info I found this old thread https://groups.google.com/forum/#!topic/adt-dev/3F-47oCzW0w that seems pretty relevant.
>
>
> The functionality has to be the same, so I'd rather not change the artifactid. I would probably call it a different version before doing that. It seems like this kind of flavor would most closely resemble a classifier, but I'm not familiar enough with that to know for sure.
>
>
> On Monday, June 30, 2014 10:51:45 AM UTC-4, Malachi de AElfweald wrote:
>>
>>
>> If you are building two different flavors of your library, in theory there is something different about them?
>>
>>
>> If it is just the version (ie beta / stable) then obviously you'd just change the version.
>>
>> If it is core functionality, like Google Play vs Amazon support, I'd probably change the artifact id.
>>
>>
>> As a last resort, if you want groupId/artifactId/version to remain the same, you could change the classifier...
>>
>>
>> On Mon, Jun 30, 2014 at 6:16 AM, Kevin Kovach <kov...@gmail.com <%20target=> > wrote:
>>>
>>> I posted this over on the Android Developers group and didn't get a response. I thought this might be a better/alternative spot for the question.
>>>
>>>
>>> I have a android library project that I'm building with Gradle that has two flavors. I need to upload this library in both flavors to our local maven repository for use in other projects. The issue I'm having is that I cannot figure out how these flavors play into the maven group, artifact, version scheme so that I can use them as dependencies in other projects. Should I just be modifying the version based on the flavor before uploading it? Or, is there some other way of referencing flavors that I am unaware of? Thanks.
>>>
>>>
>>> - Kevin
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-developers+ <%20target=> unsub...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/ <https://groups.google.com/d/optout> optout.
>>
>>
>> --
>>
>>
>> Thank you,
>>
>> Malachi de Ælfweald | Technology Team | Upsight
>>
>>
>> Mobile: +1 503-307-1597
>> Skype: malachid69 | Find me on LinkedIn <http://www.linkedin.com/in/malachid/>
>>
>>
>> Get the Best Mobile Marketing and Analytics free <http://www.upsight.com/> | Upsight is Hiring! <http://www.upsight.com/company/#careers>
>>
>> Check Out Our Blog <http://upsight.com/blog> | Follow Us @GetUpsight <http://www.twitter.com/getupsight%20%20>
>>
>>
> --
> You received this message because you are subscribed to the Google Groups "Maven Android Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to maven-android-deve...@googlegroups.com <mailto:maven-android-deve...@googlegroups.com> .
> For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout> .
Reply all
Reply to author
Forward
0 new messages