adwiv / android-fat-aar

Gradle script that allows you to merge and embed dependencies in generted aar file
The Unlicense
1.46k stars 435 forks source link

Suppport pure java lib #38

Closed jonbryantnz closed 7 years ago

jonbryantnz commented 7 years ago

Hello,

This is a fix for embedding pure java library projects.

I've separated the concerns of "jar" libraries from "aar" libraries within the script.

The aar libraries contains resources, assets, manifest files. These items don't exist within a java library, which causes some issues.

The initial issue was that embedded jar libraries are getting added to the embeddedAarDir array. This had two consequences:

adwiv commented 7 years ago

Thanks for the merge request. I think there is an issue with collectDependencies in the request. It is called recursively to traverse the dependency tree, so all of the AAR projects defined as sub dependency will get embedded.

For example, if any of the embedded projects depend on android support library, that library gets added to embeddedAarDirs and gets embedded too.

I am going to release a new version of script that does not need proguard or sub dependencies. I'll use part of your code to make pure java libs work.

Will let you know once that is released so that you can test.

Cheers.

adwiv commented 7 years ago

Hey Jon, please check the latest release and verify it works for you.

I am collecting only the AAR files into the embeddedAarDirs while Jar files go into embeddedJars variable. We simply copy the embedded jars to the libs directory. The manifest issue is solved automatically.

Cheers.