blob: d55583eb9ba460d7db699f3293d2605ad2df364f [file] [log] [blame]
Aurimas Liutikas526389b2018-02-27 14:01:24 -08001import androidx.build.LibraryGroups
2import androidx.build.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.
Aurimas Liutikasac5fe7c2018-03-06 14:40:53 -080016 exclude('androidx/annotation/ProductionVisibility.class')
17 exclude('androidx/annotation/DimensionUnit.class')
Aurimas Liutikasc0948672017-09-21 11:54:20 -070018 preserveFileTimestamps = false
Aurimas Liutikasc2a3ff82018-01-11 13:46:08 -080019 reproducibleFileOrder = true
Tor Norbyebe61afa2013-11-13 09:58:36 -080020}
21
Tor Norbyebe61afa2013-11-13 09:58:36 -080022// configuration for the javadoc to include all source sets.
23javadoc {
24 source sourceSets.main.allJava
25}
26
Neil Fuller9bbcf882016-01-22 14:58:30 -080027// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
28if (JavaVersion.current().isJava8Compatible()) {
29 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040030 if (options.doclet == null) {
31 options.addBooleanOption('Xdoclint:none', true)
32 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080033 }
34}
35
Tor Norbyebe61afa2013-11-13 09:58:36 -080036task 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
Tor Norbyebe61afa2013-11-13 09:58:36 -080049 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070050 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080051}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070052
53supportLibrary {
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080054 name = "Android Support Library Annotations"
55 publish = true
Aurimas Liutikas78c1ab72017-11-08 13:33:51 -080056 mavenVersion = LibraryVersions.SUPPORT_LIBRARY
Aurimas Liutikasac5fe7c2018-03-06 14:40:53 -080057 mavenGroup = LibraryGroups.ANNOTATION
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080058 inceptionYear = "2013"
59 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 -070060}