blob: dd4a5bc46042b336af8444002129a4a6f851e259 [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 -080030task javadocJar(type: Jar, dependsOn:javadoc) {
31 classifier 'javadoc'
32 from javadoc.destinationDir
33}
34
Tor Norbyef6ac5e12016-09-07 12:47:35 -070035task annotationsZip(type: Zip) {
36 classifier 'annotations'
37 from 'external-annotations'
38}
39
40// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080041artifacts {
42 archives jar
Tor Norbyebe61afa2013-11-13 09:58:36 -080043 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070044 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080045}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070046
47supportLibrary {
48 name 'Android Support Library Annotations'
49 publish true
50 inceptionYear '2013'
51 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."
52}