blob: ca5cf46d967e1397a3e4a692a674757c0f290649 [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
Aurimas Liutikas8feb8c22017-01-29 11:51:03 -08007compileJava {
8 sourceCompatibility = JavaVersion.VERSION_1_7
9 targetCompatibility = JavaVersion.VERSION_1_7
10}
Justin Klaassen68e7adb2016-01-21 12:50:47 -080011
Tor Norbyebe61afa2013-11-13 09:58:36 -080012jar {
13 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -070014 // Strip out typedef classes. For Android libraries, this is done
15 // automatically by the Gradle plugin, but the Annotation library is a
16 // plain jar, built by the regular Gradle java plugin. The typedefs
17 // themselves have been manually extracted into the
18 // external-annotations directory, and those are packaged separately
19 // below by the annotationsZip task.
20 exclude('android/support/annotation/ProductionVisibility.class')
21 exclude('android/support/annotation/DimensionUnit.class')
Tor Norbyebe61afa2013-11-13 09:58:36 -080022}
23
Tor Norbyebe61afa2013-11-13 09:58:36 -080024// configuration for the javadoc to include all source sets.
25javadoc {
26 source sourceSets.main.allJava
27}
28
Neil Fuller9bbcf882016-01-22 14:58:30 -080029// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
30if (JavaVersion.current().isJava8Compatible()) {
31 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040032 if (options.doclet == null) {
33 options.addBooleanOption('Xdoclint:none', true)
34 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080035 }
36}
37
Tor Norbyebe61afa2013-11-13 09:58:36 -080038// custom tasks for creating source/javadoc jars
39task sourcesJar(type: Jar, dependsOn:classes) {
40 classifier = 'sources'
41 from sourceSets.main.allSource
42}
43
44task javadocJar(type: Jar, dependsOn:javadoc) {
45 classifier 'javadoc'
46 from javadoc.destinationDir
47}
48
Tor Norbyef6ac5e12016-09-07 12:47:35 -070049task annotationsZip(type: Zip) {
50 classifier 'annotations'
51 from 'external-annotations'
52}
53
54// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080055artifacts {
56 archives jar
57 archives sourcesJar
58 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070059 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080060}
Aurimas Liutikasca04e9a2017-08-23 21:19:51 -070061
62supportLibrary {
63 name 'Android Support Library Annotations'
64 publish true
65 inceptionYear '2013'
66 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."
67}