Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for local external dependencies #18

Open
jonbryantnz opened this issue Jan 10, 2019 · 3 comments
Open

Support for local external dependencies #18

jonbryantnz opened this issue Jan 10, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@jonbryantnz
Copy link
Contributor

Hello,

Summary
aar libraries that are stored locally in the projects libs directory and are referenced as dependent aren't packaged in the final aar.

Example
If we reference a local aar library directly within the build.gradle files dependencies:

dependencies {
    api (name: 'example-native-local-lib', ext: 'aar')
}

And within the sample file structure we have the below file:
example-lib/libs/example-native-local-lib.aar

This library isn't included in the built aar.

Code
When the analyzeDependencies() method within CopyDependenciesTask.groovy detects an external dependency, it expects the dependant libraries path to be found at the following location:
<gradleUserHomeDir>/caches/modules-2/files-2.1/

This is fine if the dependency has been downloaded from an external repository however
this isn't always the case (as demonstrated in the above example).

Thanks,
Jon

@oscarcpozas oscarcpozas added the enhancement New feature or request label Jan 10, 2019
@oscarcpozas
Copy link
Contributor

Hey @TomTasche,

Yep, you are right. Right now, I assume the same location for all dependencies because I can't find a correct way to determine if an artifact is from dependency manager (downloaded from internet) or it's stored locally on any location. Any suggestion?

jonbryantnz added a commit to jonbryantnz/fataar-gradle-plugin that referenced this issue Jan 10, 2019
Added a new  example that builds a native library (example-local-native-lib-in-libs).  
The built native library was added manually to example-lib/libs/
@jonbryantnz
Copy link
Contributor Author

Hello @oscarcpozas ,

I've added a pull request for this issue.
I can't find a method in gradle that allows us to find automatically the dependency path.
What I ended up using was a trial and error approach. For example, try path A, if it doesn't exist, then try path B.

Regards,
Jon

PS Thanks again for this plugin!

@oscarcpozas
Copy link
Contributor

#20 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants