blob: 6071820cee15ff5758235ef8119d8743dbb72ce4 [file] [log] [blame]
Tor Norbyebe61afa2013-11-13 09:58:36 -08001apply plugin: 'java'
Tor Norbyebe61afa2013-11-13 09:58:36 -08002archivesBaseName = 'support-annotations'
3
4sourceSets {
Tor Norbyedc024b32014-03-19 09:30:22 -07005 main.java.srcDir 'src'
Tor Norbyebe61afa2013-11-13 09:58:36 -08006}
7
Aurimas Liutikas8feb8c22017-01-29 11:51:03 -08008compileJava {
9 sourceCompatibility = JavaVersion.VERSION_1_7
10 targetCompatibility = JavaVersion.VERSION_1_7
11}
Justin Klaassen68e7adb2016-01-21 12:50:47 -080012
Tor Norbyebe61afa2013-11-13 09:58:36 -080013jar {
14 from sourceSets.main.output
Tor Norbye5dcac272016-09-09 09:15:10 -070015 // Strip out typedef classes. For Android libraries, this is done
16 // automatically by the Gradle plugin, but the Annotation library is a
17 // plain jar, built by the regular Gradle java plugin. The typedefs
18 // themselves have been manually extracted into the
19 // external-annotations directory, and those are packaged separately
20 // below by the annotationsZip task.
21 exclude('android/support/annotation/ProductionVisibility.class')
22 exclude('android/support/annotation/DimensionUnit.class')
Tor Norbyebe61afa2013-11-13 09:58:36 -080023}
24
25uploadArchives {
26 repositories {
27 mavenDeployer {
28
Xavier Ducrohet855a9222014-01-02 19:00:43 -080029 repository(url: uri(rootProject.ext.supportRepoOut)) {
Tor Norbyebe61afa2013-11-13 09:58:36 -080030 }
31
32 pom.project {
33 name 'Android Support Library Annotations'
34 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."
35 url 'http://developer.android.com/tools/extras/support-library.html'
36 inceptionYear '2013'
37
38 licenses {
39 license {
40 name 'The Apache Software License, Version 2.0'
41 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
42 distribution 'repo'
43 }
44 }
45
46 scm {
47 url "http://source.android.com"
48 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
49 }
50 developers {
51 developer {
52 name 'The Android Open Source Project'
53 }
54 }
55 }
56 }
57 }
58}
59
60// configuration for the javadoc to include all source sets.
61javadoc {
62 source sourceSets.main.allJava
63}
64
Neil Fuller9bbcf882016-01-22 14:58:30 -080065// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
66if (JavaVersion.current().isJava8Compatible()) {
67 tasks.withType(Javadoc) {
68 options.addBooleanOption('Xdoclint:none', true)
69 }
70}
71
Tor Norbyebe61afa2013-11-13 09:58:36 -080072// custom tasks for creating source/javadoc jars
73task sourcesJar(type: Jar, dependsOn:classes) {
74 classifier = 'sources'
75 from sourceSets.main.allSource
76}
77
78task javadocJar(type: Jar, dependsOn:javadoc) {
79 classifier 'javadoc'
80 from javadoc.destinationDir
81}
82
Tor Norbyef6ac5e12016-09-07 12:47:35 -070083task annotationsZip(type: Zip) {
84 classifier 'annotations'
85 from 'external-annotations'
86}
87
88// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080089artifacts {
90 archives jar
91 archives sourcesJar
92 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070093 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080094}