Skip to content

Commit 3d3ed56

Browse files
committed
Merge pull request square#156 from square/jw/jars
Include jar artifacts.
2 parents 4ea64a0 + 982478d commit 3d3ed56

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

build.gradle

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ subprojects {
1111
repositories {
1212
mavenCentral()
1313
}
14-
14+
1515
group = GROUP
1616
version = VERSION_NAME
1717
}
@@ -21,3 +21,17 @@ ext {
2121
compileSdkVersion = 22
2222
buildToolsVersion = '22.0.0'
2323
}
24+
25+
subprojects {
26+
afterEvaluate {
27+
android.libraryVariants.all { variant ->
28+
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
29+
task.description = "Create jar artifact for ${variant.name}"
30+
task.dependsOn variant.javaCompile
31+
task.from variant.javaCompile.destinationDir
32+
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
33+
task.archiveName = "${project.name}-${variant.baseName}.jar"
34+
artifacts.add('archives', task);
35+
}
36+
}
37+
}

0 commit comments

Comments
 (0)