1

I want to add a folder, containing some native libraries, as a runtime dependency.

I try the following syntax:

dependencies {
   runtime files('path/to/libraries')
}

But instead the content of 'path/to/libraries' is added, while I need to have 'libraries' folder added.

FileCollections interface has filter method, so I tried to create file('path/to') collections and then filter out everything except 'libraries' folder, but the filter method doesn't allow to filter the resulting set, only the input patterns, so it didn't work in my case. So far I didn't find a way to do that. Maybe I use Gradle in a wrong way, but I do want to have this as a dependency. Any help is appreciated.

Dmitry Trofimov
  • 7,371
  • 1
  • 30
  • 34
  • Possible duplicate of [How to add local .jar file dependency to build.gradle file?](http://stackoverflow.com/questions/20700053/how-to-add-local-jar-file-dependency-to-build-gradle-file) – Michael Easter Aug 20 '16 at 16:40
  • @MichaelEaster No it is different. fileTree() doesn't work here as it doesn't preserve the folder structure. files() doesn't work here as it adds only the content of the folder, not the folder itself. – Dmitry Trofimov Aug 21 '16 at 10:00

0 Answers0