blob: 2e8fbabe6879745fd219b1c9c69b3abc0e81d239 [file] [log] [blame]
Aurimas Liutikasf8b708a2017-11-02 16:07:13 -07001plugins {
2 id("SupportJavaLibraryPlugin")
3}
Tor Norbyebe61afa2013-11-13 09:58:36 -08004
Tor Norbyebe61afa2013-11-13 09:58:36 -08005jar {
6 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -07007 // Strip out typedef classes. For Android libraries, this is done
8 // automatically by the Gradle plugin, but the Annotation library is a
9 // plain jar, built by the regular Gradle java plugin. The typedefs
10 // themselves have been manually extracted into the
11 // external-annotations directory, and those are packaged separately
12 // below by the annotationsZip task.
13 exclude('android/support/annotation/ProductionVisibility.class')
14 exclude('android/support/annotation/DimensionUnit.class')
Aurimas Liutikasc0948672017-09-21 11:54:20 -070015 preserveFileTimestamps = false
Tor Norbyebe61afa2013-11-13 09:58:36 -080016}
17
Tor Norbyebe61afa2013-11-13 09:58:36 -080018// configuration for the javadoc to include all source sets.
19javadoc {
20 source sourceSets.main.allJava
21}
22
Neil Fuller9bbcf882016-01-22 14:58:30 -080023// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
24if (JavaVersion.current().isJava8Compatible()) {
25 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040026 if (options.doclet == null) {
27 options.addBooleanOption('Xdoclint:none', true)
28 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080029 }
30}
31
Tor Norbyebe61afa2013-11-13 09:58:36 -080032task javadocJar(type: Jar, dependsOn:javadoc) {
33 classifier 'javadoc'
34 from javadoc.destinationDir
35}
36
Tor Norbyef6ac5e12016-09-07 12:47:35 -070037task annotationsZip(type: Zip) {
38 classifier 'annotations'
39 from 'external-annotations'
40}
41
42// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080043artifacts {
44 archives jar
Tor Norbyebe61afa2013-11-13 09:58:36 -080045 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070046 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080047}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070048
49supportLibrary {
50 name 'Android Support Library Annotations'
51 publish true
52 inceptionYear '2013'
53 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."
54}