Aurimas Liutikas | f8b708a | 2017-11-02 16:07:13 -0700 | [diff] [blame] | 1 | plugins { |
| 2 | id("SupportJavaLibraryPlugin") |
| 3 | } |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 4 | |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 5 | jar { |
| 6 | from sourceSets.main.output |
Tor Norbye | 5dcac27 | 2016-09-09 09:15:10 -0700 | [diff] [blame] | 7 | // 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 Liutikas | c094867 | 2017-09-21 11:54:20 -0700 | [diff] [blame] | 15 | preserveFileTimestamps = false |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 16 | } |
| 17 | |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 18 | // configuration for the javadoc to include all source sets. |
| 19 | javadoc { |
| 20 | source sourceSets.main.allJava |
| 21 | } |
| 22 | |
Neil Fuller | 9bbcf88 | 2016-01-22 14:58:30 -0800 | [diff] [blame] | 23 | // Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780 |
| 24 | if (JavaVersion.current().isJava8Compatible()) { |
| 25 | tasks.withType(Javadoc) { |
Alan Viverette | 7b68068 | 2017-08-11 10:46:13 -0400 | [diff] [blame] | 26 | if (options.doclet == null) { |
| 27 | options.addBooleanOption('Xdoclint:none', true) |
| 28 | } |
Neil Fuller | 9bbcf88 | 2016-01-22 14:58:30 -0800 | [diff] [blame] | 29 | } |
| 30 | } |
| 31 | |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 32 | task javadocJar(type: Jar, dependsOn:javadoc) { |
| 33 | classifier 'javadoc' |
| 34 | from javadoc.destinationDir |
| 35 | } |
| 36 | |
Tor Norbye | f6ac5e1 | 2016-09-07 12:47:35 -0700 | [diff] [blame] | 37 | task annotationsZip(type: Zip) { |
| 38 | classifier 'annotations' |
| 39 | from 'external-annotations' |
| 40 | } |
| 41 | |
| 42 | // add javadoc/source/annotations jar tasks as artifacts |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 43 | artifacts { |
| 44 | archives jar |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 45 | archives javadocJar |
Tor Norbye | f6ac5e1 | 2016-09-07 12:47:35 -0700 | [diff] [blame] | 46 | archives annotationsZip |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 47 | } |
Aurimas Liutikas | ca04e9a | 2017-08-23 21:19:51 -0700 | [diff] [blame] | 48 | |
| 49 | supportLibrary { |
Aurimas Liutikas | ea5ee82 | 2017-11-06 12:52:28 -0800 | [diff] [blame^] | 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." |
Aurimas Liutikas | ca04e9a | 2017-08-23 21:19:51 -0700 | [diff] [blame] | 54 | } |