I exporting Android library via building aar
with Gradle, and I have requirements for the jar
inside the aar
: Basically I need the jar to reflect following files structure that already exist in the project (jpeg files should be inside java package alongside .class
files):
project_name
|
module_name
|
src
|
main
|
java
|
package_to_include
|
java_files
jpeg_files
package_to_exclude
This is the relevant part from build.gradle
script:
apply plugin: 'com.android.library'
android {
...
sourceSets {
main {
java {
srcDir 'src/main/java'
exclude 'package_to_exclude/**'
resources.includes = [ 'package_to_include/*.jpeg' ]
}
resources {
srcDir 'src/../lib'
}
}
}
}
Result: The exclude part works, the include not: In the jar inside package_to_include there are only the java source code files as .class
files. The jpeg's not in the jar at all.
By the way I'm not totally familiar with the double astrix (**) operator. Maybe this is the direction for solution?
Thanks,