I have a android project including some modules and want to build each module as a jar file including all depending sources and jar libraries.
Ive changed my gradle file and it builds my module nicely, but without the depending sources and jars.
Here is my gradle file
apply plugin: 'com.android.library'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
java {
srcDir 'src'
}
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.parse.bolts:bolts-android:1.2.0'
}
task clearJar(type: Delete) {
delete 'build/libs/myFancyLib.jar'
}
task makeJar(type: Copy) {
from('build/intermediates/bundles/release/')
into('build/libs/')
include('classes.jar')
rename ('classes.jar', 'myFancyLib.jar')
}
makeJar.dependsOn(clearJar, build)