blob: 195a0e7514eade9fd256747feebe76b9048d710e [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 {
27
Xavier Ducrohet855a9222014-01-02 19:00:43 -080028 repository(url: uri(rootProject.ext.supportRepoOut)) {
Tor Norbyebe61afa2013-11-13 09:58:36 -080029 }
30
31 pom.project {
32 name 'Android Support Library Annotations'
33 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."
34 url 'http://developer.android.com/tools/extras/support-library.html'
35 inceptionYear '2013'
36
37 licenses {
38 license {
39 name 'The Apache Software License, Version 2.0'
40 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
41 distribution 'repo'
42 }
43 }
44
45 scm {
46 url "http://source.android.com"
47 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
48 }
49 developers {
50 developer {
51 name 'The Android Open Source Project'
52 }
53 }
54 }
55 }
56 }
57}
58
59// configuration for the javadoc to include all source sets.
60javadoc {
61 source sourceSets.main.allJava
62}
63
Neil Fuller9bbcf882016-01-22 14:58:30 -080064// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
65if (JavaVersion.current().isJava8Compatible()) {
66 tasks.withType(Javadoc) {
67 options.addBooleanOption('Xdoclint:none', true)
68 }
69}
70
Tor Norbyebe61afa2013-11-13 09:58:36 -080071// custom tasks for creating source/javadoc jars
72task sourcesJar(type: Jar, dependsOn:classes) {
73 classifier = 'sources'
74 from sourceSets.main.allSource
75}
76
77task javadocJar(type: Jar, dependsOn:javadoc) {
78 classifier 'javadoc'
79 from javadoc.destinationDir
80}
81
Tor Norbyef6ac5e12016-09-07 12:47:35 -070082task annotationsZip(type: Zip) {
83 classifier 'annotations'
84 from 'external-annotations'
85}
86
87// add javadoc/source/annotations jar tasks as artifacts
Tor Norbyebe61afa2013-11-13 09:58:36 -080088artifacts {
89 archives jar
90 archives sourcesJar
91 archives javadocJar
Tor Norbyef6ac5e12016-09-07 12:47:35 -070092 archives annotationsZip
Tor Norbyebe61afa2013-11-13 09:58:36 -080093}