| import androidx.build.LibraryGroups |
| import androidx.build.LibraryVersions |
| |
| plugins { |
| id("AndroidXPlugin") |
| id("java") |
| } |
| |
| jar { |
| from sourceSets.main.output |
| // Strip out typedef classes. For Android libraries, this is done |
| // automatically by the Gradle plugin, but the Annotation library is a |
| // plain jar, built by the regular Gradle java plugin. The typedefs |
| // themselves have been manually extracted into the |
| // external-annotations directory, and those are packaged separately |
| // below by the annotationsZip task. |
| exclude('androidx/annotation/ProductionVisibility.class') |
| exclude('androidx/annotation/DimensionUnit.class') |
| preserveFileTimestamps = false |
| reproducibleFileOrder = true |
| } |
| |
| // configuration for the javadoc to include all source sets. |
| javadoc { |
| source sourceSets.main.allJava |
| } |
| |
| // Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780 |
| if (JavaVersion.current().isJava8Compatible()) { |
| tasks.withType(Javadoc) { |
| if (options.doclet == null) { |
| options.addBooleanOption('Xdoclint:none', true) |
| } |
| // We set the group to null so it doesn't show if a user runs `./gradlew tasks` |
| // because this task is specific to this project |
| group = null |
| } |
| } |
| |
| task javadocJar(type: Jar, dependsOn:javadoc) { |
| classifier 'javadoc' |
| from javadoc.destinationDir |
| } |
| |
| task annotationsZip(type: Zip) { |
| classifier 'annotations' |
| from 'external-annotations' |
| } |
| |
| // add javadoc/source/annotations jar tasks as artifacts |
| artifacts { |
| archives jar |
| archives javadocJar |
| archives annotationsZip |
| } |
| |
| androidx { |
| name = "Android Support Library Annotations" |
| publish = true |
| mavenVersion = LibraryVersions.ANNOTATION |
| mavenGroup = LibraryGroups.ANNOTATION |
| inceptionYear = "2013" |
| 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." |
| } |