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