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