blob: df521e1fcfb421ad32ac5b5ec82f51649551a980 [file] [log] [blame]
Aurimas Liutikas7f40a7e2017-10-27 17:55:06 -07001import android.support.LibraryGroups
Aurimas Liutikas78c1ab72017-11-08 13:33:51 -08002import android.support.LibraryVersions
Aurimas Liutikas7f40a7e2017-10-27 17:55:06 -07003
Aurimas Liutikasf8b708a2017-11-02 16:07:13 -07004plugins {
5 id("SupportJavaLibraryPlugin")
6}
Tor Norbyebe61afa2013-11-13 09:58:36 -08007
Tor Norbyebe61afa2013-11-13 09:58:36 -08008jar {
9 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -070010 // Strip out typedef classes. For Android libraries, this is done
11 // automatically by the Gradle plugin, but the Annotation library is a
12 // plain jar, built by the regular Gradle java plugin. The typedefs
13 // themselves have been manually extracted into the
14 // external-annotations directory, and those are packaged separately
15 // below by the annotationsZip task.
16 exclude('android/support/annotation/ProductionVisibility.class')
17 exclude('android/support/annotation/DimensionUnit.class')
Aurimas Liutikasc0948672017-09-21 11:54:20 -070018 preserveFileTimestamps = false
Tor Norbyebe61afa2013-11-13 09:58:36 -080019}
20
Tor Norbyebe61afa2013-11-13 09:58:36 -080021// configuration for the javadoc to include all source sets.
22javadoc {
23 source sourceSets.main.allJava
24}
25
Neil Fuller9bbcf882016-01-22 14:58:30 -080026// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
27if (JavaVersion.current().isJava8Compatible()) {
28 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040029 if (options.doclet == null) {
30 options.addBooleanOption('Xdoclint:none', true)
31 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080032 }
33}
34
Tor Norbyebe61afa2013-11-13 09:58:36 -080035task javadocJar(type: Jar, dependsOn:javadoc) {
36 classifier 'javadoc'
37 from javadoc.destinationDir
38}
39
Tor Norbyef6ac5e12016-09-07 12:47:35 -070040task annotationsZip(type: Zip) {
41 classifier 'annotations'
42 from 'external-annotations'
43}
44
45// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080046artifacts {
47 archives jar
Tor Norbyebe61afa2013-11-13 09:58:36 -080048 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070049 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080050}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070051
52supportLibrary {
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080053 name = "Android Support Library Annotations"
54 publish = true
Aurimas Liutikas78c1ab72017-11-08 13:33:51 -080055 mavenVersion = LibraryVersions.SUPPORT_LIBRARY
Aurimas Liutikas7f40a7e2017-10-27 17:55:06 -070056 mavenGroup = LibraryGroups.SUPPORT
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080057 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."
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070059}