Hi Pavel,

Have you found any good way of doing this? More specifically I'm looking to 
include all dependencies for my android library project in the classes.jar, 
do you know if this is possible. I've set this up to work in ant but have 
yet to find any way of doing the same with gradle.

Thanks,
Jeffrey

On Tuesday, September 2, 2014 at 2:26:54 PM UTC-7, Pavel Dolgov wrote:
>
> Thank you for the reply! But with such an approach resulting 
> LibraryProject.aar will not have all dependencies packaged, unless I'm 
> missing something.
> What I'm doing right now is manually adding compiled classes to libs 
> before packageLibrary task. Works in my particular case, but obviously 
> ugly, looks like a hack does not work with resources, manifests and etc. 
> What is the better gradle/android-library way?
>
> android.libraryVariants.all { variant ->
>
>         Action copyClassesAction = new Action() {
>             @Override
>             void execute(Object o) {
>
>                 String variantLibsDir = getBuildDir().absolutePath + 
> "/intermediates/bundles/" + variant.name + "/libs"
>                 String explodedDir = getBuildDir().absolutePath + 
> "/intermediates/exploded-aar/library-project/"
>                 String[] dirs = new File(explodedDir).list()
>                 for (int i = 0; i < dirs.length; i++) {
>                     File source = new File(explodedDir + dirs[i] + 
> "/unspecified/classes.jar")
>                     File destination = new File(variantLibsDir + "/" + 
> dirs[i] + ".jar")
>                     destination.bytes = source.bytes
>                 }
>             }
>         }
>         variant.packageLibrary.doFirst(copyClassesAction)
>     }
>
> On Monday, September 1, 2014 9:03:17 AM UTC-4, William Ferguson wrote:
>>
>> As an AAR artifact deployed to your artifact repository with a POM that 
>> lists the 3 libraries as dependencies.
>>
>> William
>>
>> On Thursday, August 28, 2014 10:45:19 AM UTC+10, Pavel Dolgov wrote:
>>>
>>> I have a library project with dependencies like: 
>>>
>>> LibraryProject
>>> --\LibraryA
>>> --\LibraryB
>>> --\LibraryC
>>>
>>> What I want to achieve is a LibraryProject.aar with all dependencies 
>>> compiled and included, so when used in an application, there is no need to 
>>> add any dependencies for LibraryA, LibraryB and LibraryC. What is the best 
>>> way to achieve the goal? 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 adt-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to