• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1import androidx.build.LibraryGroups
2import androidx.build.LibraryVersions
3
4plugins {
5    id("SupportJavaLibraryPlugin")
6}
7
8jar {
9    from sourceSets.main.output
10    // Strip out typedef classes. For Android libraries, this is done
11    // automatically by the Gradle plugin, but the Annotation library is a
12    // plain jar, built by the regular Gradle java plugin. The typedefs
13    // themselves have been manually extracted into the
14    // external-annotations directory, and those are packaged separately
15    // below by the annotationsZip task.
16    exclude('androidx/annotation/ProductionVisibility.class')
17    exclude('androidx/annotation/DimensionUnit.class')
18    preserveFileTimestamps = false
19    reproducibleFileOrder = true
20}
21
22// configuration for the javadoc to include all source sets.
23javadoc {
24    source    sourceSets.main.allJava
25}
26
27// Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780
28if (JavaVersion.current().isJava8Compatible()) {
29    tasks.withType(Javadoc) {
30        if (options.doclet == null) {
31            options.addBooleanOption('Xdoclint:none', true)
32        }
33    }
34}
35
36task javadocJar(type: Jar, dependsOn:javadoc) {
37    classifier         'javadoc'
38    from               javadoc.destinationDir
39}
40
41task annotationsZip(type: Zip) {
42    classifier         'annotations'
43    from               'external-annotations'
44}
45
46// add javadoc/source/annotations jar tasks as artifacts
47artifacts {
48    archives jar
49    archives javadocJar
50    archives annotationsZip
51}
52
53supportLibrary {
54    name = "Android Support Library Annotations"
55    publish = true
56    mavenVersion = LibraryVersions.SUPPORT_LIBRARY
57    mavenGroup = LibraryGroups.ANNOTATION
58    inceptionYear = "2013"
59    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."
60}