provide both jar and aar

This commit is contained in:
Oleg Godovykh
2015-04-29 14:18:44 -04:00
parent 119a981701
commit 14c2d14fc2
2 changed files with 24 additions and 0 deletions

View File

@@ -40,4 +40,16 @@ dependencies {
compile "org.apache.httpcomponents:httpclient:$httpclient_version"
compile "org.apache.httpcomponents:httpmime:$httpclient_version"
testCompile "junit:junit:$junit_version"
}
afterEvaluate {
android.libraryVariants.all { variant ->
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
task.description = "Create jar artifact for ${variant.name}"
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
task.archiveName = "${project.name}-${variant.baseName}.jar"
artifacts.add('archives', task);
}
}