blob: a8c280961e43894848cd301d45cf0537dffff1bc [file] [log] [blame]
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -07001apply plugin: android.support.SupportJavaLibraryPlugin
Tor Norbyebe61afa2013-11-13 09:58:36 -08002
3sourceSets {
Tor Norbyedc024b32014-03-19 09:30:22 -07004 main.java.srcDir 'src'
Tor Norbyebe61afa2013-11-13 09:58:36 -08005}
6
7jar {
8 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -07009 // Strip out typedef classes. For Android libraries, this is done
10 // automatically by the Gradle plugin, but the Annotation library is a
11 // plain jar, built by the regular Gradle java plugin. The typedefs
12 // themselves have been manually extracted into the
13 // external-annotations directory, and those are packaged separately
14 // below by the annotationsZip task.
15 exclude('android/support/annotation/ProductionVisibility.class')
16 exclude('android/support/annotation/DimensionUnit.class')
Tor Norbyebe61afa2013-11-13 09:58:36 -080017}
18
Tor Norbyebe61afa2013-11-13 09:58:36 -080019// configuration for the javadoc to include all source sets.
20javadoc {
21 source sourceSets.main.allJava
22}
23
Neil Fuller9bbcf882016-01-22 14:58:30 -080024// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
25if (JavaVersion.current().isJava8Compatible()) {
26 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040027 if (options.doclet == null) {
28 options.addBooleanOption('Xdoclint:none', true)
29 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080030 }
31}
32
Tor Norbyebe61afa2013-11-13 09:58:36 -080033// custom tasks for creating source/javadoc jars
34task sourcesJar(type: Jar, dependsOn:classes) {
35 classifier = 'sources'
36 from sourceSets.main.allSource
37}
38
39task javadocJar(type: Jar, dependsOn:javadoc) {
40 classifier 'javadoc'
41 from javadoc.destinationDir
42}
43
Tor Norbyef6ac5e12016-09-07 12:47:35 -070044task annotationsZip(type: Zip) {
45 classifier 'annotations'
46 from 'external-annotations'
47}
48
49// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080050artifacts {
51 archives jar
52 archives sourcesJar
53 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070054 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080055}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070056
57supportLibrary {
58 name 'Android Support Library Annotations'
59 publish true
60 inceptionYear '2013'
61 description "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs."
62}