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 [email protected].
For more options, visit https://groups.google.com/d/optout.