blob: af4174d68503b86a9b5c95060bde296a5f190c92 [file] [log] [blame]
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -07001apply plugin: android.support.SupportJavaLibraryPlugin
Tor Norbyebe61afa2013-11-13 09:58:36 -08002
Tor Norbyebe61afa2013-11-13 09:58:36 -08003jar {
4 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -07005 // Strip out typedef classes. For Android libraries, this is done
6 // automatically by the Gradle plugin, but the Annotation library is a
7 // plain jar, built by the regular Gradle java plugin. The typedefs
8 // themselves have been manually extracted into the
9 // external-annotations directory, and those are packaged separately
10 // below by the annotationsZip task.
11 exclude('android/support/annotation/ProductionVisibility.class')
12 exclude('android/support/annotation/DimensionUnit.class')
Aurimas Liutikasc0948672017-09-21 11:54:20 -070013 preserveFileTimestamps = false
Tor Norbyebe61afa2013-11-13 09:58:36 -080014}
15
Tor Norbyebe61afa2013-11-13 09:58:36 -080016// configuration for the javadoc to include all source sets.
17javadoc {
18 source sourceSets.main.allJava
19}
20
Neil Fuller9bbcf882016-01-22 14:58:30 -080021// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
22if (JavaVersion.current().isJava8Compatible()) {
23 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040024 if (options.doclet == null) {
25 options.addBooleanOption('Xdoclint:none', true)
26 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080027 }
28}
29
Tor Norbyebe61afa2013-11-13 09:58:36 -080030// custom tasks for creating source/javadoc jars
31task sourcesJar(type: Jar, dependsOn:classes) {
32 classifier = 'sources'
33 from sourceSets.main.allSource
34}
35
36task javadocJar(type: Jar, dependsOn:javadoc) {
37 classifier 'javadoc'
38 from javadoc.destinationDir
39}
40
Tor Norbyef6ac5e12016-09-07 12:47:35 -070041task annotationsZip(type: Zip) {
42 classifier 'annotations'
43 from 'external-annotations'
44}
45
46// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080047artifacts {
48 archives jar
49 archives sourcesJar
50 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070051 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080052}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070053
54supportLibrary {
55 name 'Android Support Library Annotations'
56 publish true
57 inceptionYear '2013'
58 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."
59}