1apply plugin: 'java'
2archivesBaseName = 'support-annotations'
3
4sourceSets {
5    main.java.srcDir 'src'
6}
7
8compileJava {
9    sourceCompatibility = JavaVersion.VERSION_1_7
10    targetCompatibility = JavaVersion.VERSION_1_7
11}
12
13jar {
14    from sourceSets.main.output
15    // 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')
23}
24
25uploadArchives {
26    repositories {
27        mavenDeployer {
28
29            repository(url: uri(rootProject.ext.supportRepoOut)) {
30            }
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
65// 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
72// 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
83task annotationsZip(type: Zip) {
84    classifier         'annotations'
85    from               'external-annotations'
86}
87
88// add javadoc/source/annotations jar tasks as artifacts
89artifacts {
90    archives jar
91    archives sourcesJar
92    archives javadocJar
93    archives annotationsZip
94}
95