blob: 4bedc3f7b4b12d4908531f54b374de9dd205bb6b [file] [log] [blame]
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -07001apply plugin: android.support.SupportJavaLibraryPlugin
Tor Norbyebe61afa2013-11-13 09:58:36 -08002
3sourceSets {
Tor Norbyedc024b32014-03-19 09:30:22 -07004 main.java.srcDir 'src'
Tor Norbyebe61afa2013-11-13 09:58:36 -08005}
6
7jar {
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 -080034// custom tasks for creating source/javadoc jars
35task sourcesJar(type: Jar, dependsOn:classes) {
36 classifier = 'sources'
37 from sourceSets.main.allSource
38}
39
40task javadocJar(type: Jar, dependsOn:javadoc) {
41 classifier 'javadoc'
42 from javadoc.destinationDir
43}
44
Tor Norbyef6ac5e12016-09-07 12:47:35 -070045task annotationsZip(type: Zip) {
46 classifier 'annotations'
47 from 'external-annotations'
48}
49
50// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080051artifacts {
52 archives jar
53 archives sourcesJar
54 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070055 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080056}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070057
58supportLibrary {
59 name 'Android Support Library Annotations'
60 publish true
61 inceptionYear '2013'
62 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."
63}