0

Im sure this is amazingly simple but its been a long day and the Gradle docs frustrate me at the best of times (I have looked).

I want to include a folder (libs) inside a predefinined artifact (bundleRelease).

This happens to be on android (aar build) and inside a maven-publish block like

...
releaseJar(MavenPublication) {
            ...

            artifact bundleRelease
}
...

using gradle 2.3.

Thanks for any help here :)

EDIT: answered here Include /libs/ folder in aar

Community
  • 1
  • 1
Dori
  • 18,283
  • 17
  • 74
  • 116

1 Answers1

0

Depends on what you want for the syntax but if you want the jar files in the root of the aar

android {
    ...
    sourceSets {
        main {
            resources.includes = [ '**/libs/*.jar' ]        
    }
}

If you want the entire folder included then I think this should be what you want

android {
    ...
    sourceSets {
        main {
            resources.includes = [ 'pathTo/libs' ]        
    }
}

All that said you probably don't want to package the libs with the aar because if you publish to somewhere like jcenter or mavenCentral then the maven artifact when uploaded will create a pom file that will note its dependencies and gradle will transparently import them for your lib.

JBirdVegas
  • 10,855
  • 2
  • 44
  • 50
  • Thanks for the answer, will play with this 2moro. I specifically do want to bundle the libs with the aar as this specific aar needs to distributed with private libs. – Dori Oct 20 '15 at 20:52
  • nope none of the above works - this is driving me nuts! Tried with `**/libs/*.jar` and every `/libs` I could think of... – Dori Oct 21 '15 at 07:21