Include Folder in Gradle Artifact

I'm sure this is surprisingly simple, but it was a long day, and the Gradle docs disappoint me in better times (I looked).

I want to add a folder ( libs) inside a predefined artifact ( bundleRelease).

This happens on android (aar build) and inside the block maven-publish, for example

...
releaseJar(MavenPublication) {
            ...

            artifact bundleRelease
}
...

using Gradle 2.3.

Thanks for any help here :)

EDIT: here Include / libs / folder in aar

0
source share
1 answer

Depends on what you want for the syntax, but if you want the files jarin the root directoryaar

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

If you want to include the entire folder, I think it should be what you want

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

, , , , aar, , - jcenter mavenCentral, maven pom, gradle .

0

Source: https://habr.com/ru/post/1612728/


All Articles