blob: b50cd77796b52f311f0b51e452569621e7e96c0e [file] [log] [blame]
Aurimas Liutikas7f40a7e2017-10-27 17:55:06 -07001import android.support.LibraryGroups
2
Aurimas Liutikasf8b708a2017-11-02 16:07:13 -07003plugins {
4 id("SupportJavaLibraryPlugin")
5}
Tor Norbyebe61afa2013-11-13 09:58:36 -08006
Tor Norbyebe61afa2013-11-13 09:58:36 -08007jar {
8 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -07009 // Strip out typedef classes. For Android libraries, this is done
10 // automatically by the Gradle plugin, but the Annotation library is a
11 // plain jar, built by the regular Gradle java plugin. The typedefs
12 // themselves have been manually extracted into the
13 // external-annotations directory, and those are packaged separately
14 // below by the annotationsZip task.
15 exclude('android/support/annotation/ProductionVisibility.class')
16 exclude('android/support/annotation/DimensionUnit.class')
Aurimas Liutikasc0948672017-09-21 11:54:20 -070017 preserveFileTimestamps = false
Tor Norbyebe61afa2013-11-13 09:58:36 -080018}
19
Tor Norbyebe61afa2013-11-13 09:58:36 -080020// configuration for the javadoc to include all source sets.
21javadoc {
22 source sourceSets.main.allJava
23}
24
Neil Fuller9bbcf882016-01-22 14:58:30 -080025// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
26if (JavaVersion.current().isJava8Compatible()) {
27 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040028 if (options.doclet == null) {
29 options.addBooleanOption('Xdoclint:none', true)
30 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080031 }
32}
33
Tor Norbyebe61afa2013-11-13 09:58:36 -080034task javadocJar(type: Jar, dependsOn:javadoc) {
35 classifier 'javadoc'
36 from javadoc.destinationDir
37}
38
Tor Norbyef6ac5e12016-09-07 12:47:35 -070039task annotationsZip(type: Zip) {
40 classifier 'annotations'
41 from 'external-annotations'
42}
43
44// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080045artifacts {
46 archives jar
Tor Norbyebe61afa2013-11-13 09:58:36 -080047 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070048 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080049}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070050
51supportLibrary {
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080052 name = "Android Support Library Annotations"
53 publish = true
Aurimas Liutikas7f40a7e2017-10-27 17:55:06 -070054 mavenGroup = LibraryGroups.SUPPORT
Aurimas Liutikasea5ee822017-11-06 12:52:28 -080055 inceptionYear = "2013"
56 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 -070057}