-
Notifications
You must be signed in to change notification settings - Fork 205
/
maven.gradle
33 lines (28 loc) · 1.4 KB
/
maven.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
apply plugin: 'com.github.dcendents.android-maven'
android.libraryVariants.all { variant ->
if (variant.name.contains("release")) {
task("sources${variant.name.capitalize()}Jar", type: Jar) {
from variant.javaCompile.source
classifier = 'sources'
}
task("javadoc${variant.name.capitalize()}", type: Javadoc) {
description "Generates Javadoc for $variant.name."
source = variant.javaCompile.source
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath = files(variant.javaCompile.classpath.files) + files(ext.androidJar)
options.links("http://docs.oracle.com/javase/7/docs/api/");
options.links("http://developer.android.com/reference/");
options.addStringOption('Xdoclint:none', '-quiet')
failOnError false
}
task("javadoc${variant.name.capitalize()}Jar", type: Jar, dependsOn: "javadoc${variant.name.capitalize()}") {
description "Generates Javadoc Jar for $variant.name."
classifier = 'javadoc'
from tasks.findByPath("javadoc${variant.name.capitalize()}").destinationDir
}
artifacts {
archives tasks.findByPath("javadoc${variant.name.capitalize()}Jar")
archives tasks.findByPath("sources${variant.name.capitalize()}Jar")
}
}
}