Hi everyone!
I'm currently working on this topic (depending on Android Libraries) and trying to figure out a good solution. I faced a particular problem when trying to link with an android library dependency.
Say we have the following build.gradle (I'm using "JustATrick" github user's fork until his pull request is merged):
apply plugin: 'eclipse'
apply plugin: 'android'
repositories {
mavenCentral()
maven {
}
}
buildscript {
dependencies {
classpath files('/home/matias/workspace/hackatons/gradle-android-plugin/build/libs/gradle-android-plugin-1.2.2-SNAPSHOT.jar')
}
}
dependencies {
compile 'com.mylibrary:library:1.0.0'
testRuntime group: 'junit', name: 'junit', version: '4.10'
}
When retrieving the dependencies, gradle brings the apklib and all it's transitive dependencies (i.e. ActionBarSherlock and the support jar). The code is not being dexed when doing an assemble. So I focus on the same solutions I used for maven-android-plugin.
- Multi-module project where one deploys the apklib and the other one the jar.
- Try to include in some way the code (or the jar itself) in the apklib.
While working with Maven, I could only get the first one working. So I tried to do the same for gradle-android-plugin, but with no success. Gradle always brings the apklib dependency, and ignores the jar dependency.
I'm trying to reach this so as to have the libraries deployed in a remote server. Then I'll try to figure out how to make it IDE friendly, but for now I want to have a successful build.
Any ideas?
Matías Dumrauf