I'm building an Android library for music streaming. It has ExoPlayer as dependency (excellent library btw!).
We use this library for another project that we're also developing right now, in Xamarin. Currently, we need to add both libraries (my .aar and a .jar for ExoPlayer). That's a bit annoying to be honest, I'd love to just drop my .aar in, and go.
So two questions:
- is there a way I can bundle the ExoPlayer inside my .aar, using gradle and stuff? (I'm quite a beginner here, be thorough please)
- I realise it might not be the best thing to do (dependency should be managed by app, blah blah blah), but really we will always test ExoPlayer and my lib together every time we update the former. So is there a strong reason I should not bundle ExoPlayer in my lib, or is that ok?
And here's my current gradle file. Nothing exciting to look at though. But as I converted the initial app to a lib, maybe there's something odd, who knows...
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile ('com.google.android.exoplayer:exoplayer:r1.5.6')
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
compile 'com.android.support:appcompat-v7:23.2.0'
}