I use Android Studio and have several applications that rely on the same code. I moved the shared code to a separate library to include it in my applications.
The library project ( MyLib ) that I created for this purpose requires compiling a jar file, so I added it to the libs project directory.
My build.gradlemain module MyLib is as follows:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.android"
minSdkVersion 9
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
}
}
}
dependencies {
compile files('./libs/external-java-lib.jar')
}
When I create a project, gradle generates a jar file containing external-java-lib.jar.
I want my Android application projects to provide "external-java-lib.jar", not MyLib. Because in my applications I can use different versions external-java-lib.jar.
gradle external-java-lib.jar ?
, , , , . ?
.