blob: 984ebf6d178bfd22d9a1d5cc017c084101746a13 [file] [log] [blame]
Tor Norbyebe61afa2013-11-13 09:58:36 -08001apply plugin: 'java'
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
24uploadArchives {
25 repositories {
26 mavenDeployer {
Tor Norbyebe61afa2013-11-13 09:58:36 -080027 pom.project {
28 name 'Android Support Library Annotations'
29 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."
30 url 'http://developer.android.com/tools/extras/support-library.html'
31 inceptionYear '2013'
32
33 licenses {
34 license {
35 name 'The Apache Software License, Version 2.0'
36 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
37 distribution 'repo'
38 }
39 }
40
41 scm {
42 url "http://source.android.com"
43 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
44 }
45 developers {
46 developer {
47 name 'The Android Open Source Project'
48 }
49 }
50 }
51 }
52 }
53}
54
55// configuration for the javadoc to include all source sets.
56javadoc {
57 source sourceSets.main.allJava
58}
59
Neil Fuller9bbcf882016-01-22 14:58:30 -080060// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
61if (JavaVersion.current().isJava8Compatible()) {
62 tasks.withType(Javadoc) {
Alan Viverette7b680682017-08-11 10:46:13 -040063 if (options.doclet == null) {
64 options.addBooleanOption('Xdoclint:none', true)
65 }
Neil Fuller9bbcf882016-01-22 14:58:30 -080066 }
67}
68
Tor Norbyebe61afa2013-11-13 09:58:36 -080069// custom tasks for creating source/javadoc jars
70task sourcesJar(type: Jar, dependsOn:classes) {
71 classifier = 'sources'
72 from sourceSets.main.allSource
73}
74
75task javadocJar(type: Jar, dependsOn:javadoc) {
76 classifier 'javadoc'
77 from javadoc.destinationDir
78}
79
Tor Norbyef6ac5e12016-09-07 12:47:35 -070080task annotationsZip(type: Zip) {
81 classifier 'annotations'
82 from 'external-annotations'
83}
84
85// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080086artifacts {
87 archives jar
88 archives sourcesJar
89 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070090 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080091}