Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 1 | apply plugin: 'java' |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 2 | archivesBaseName = 'support-annotations' |
| 3 | |
| 4 | sourceSets { |
Tor Norbye | dc024b3 | 2014-03-19 09:30:22 -0700 | [diff] [blame] | 5 | main.java.srcDir 'src' |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 6 | } |
| 7 | |
Aurimas Liutikas | 8feb8c2 | 2017-01-29 11:51:03 -0800 | [diff] [blame] | 8 | compileJava { |
| 9 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 10 | targetCompatibility = JavaVersion.VERSION_1_7 |
| 11 | } |
Justin Klaassen | 68e7adb | 2016-01-21 12:50:47 -0800 | [diff] [blame] | 12 | |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 13 | jar { |
| 14 | from sourceSets.main.output |
Tor Norbye | 5dcac27 | 2016-09-09 09:15:10 -0700 | [diff] [blame] | 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') |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 23 | } |
| 24 | |
| 25 | uploadArchives { |
| 26 | repositories { |
| 27 | mavenDeployer { |
| 28 | |
Xavier Ducrohet | 855a922 | 2014-01-02 19:00:43 -0800 | [diff] [blame] | 29 | repository(url: uri(rootProject.ext.supportRepoOut)) { |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 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. |
| 61 | javadoc { |
| 62 | source sourceSets.main.allJava |
| 63 | } |
| 64 | |
Neil Fuller | 9bbcf88 | 2016-01-22 14:58:30 -0800 | [diff] [blame] | 65 | // Disable strict javadoc lint checks with javadoc v8 builds on Mac. http://b/26744780 |
| 66 | if (JavaVersion.current().isJava8Compatible()) { |
| 67 | tasks.withType(Javadoc) { |
| 68 | options.addBooleanOption('Xdoclint:none', true) |
| 69 | } |
| 70 | } |
| 71 | |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 72 | // custom tasks for creating source/javadoc jars |
| 73 | task sourcesJar(type: Jar, dependsOn:classes) { |
| 74 | classifier = 'sources' |
| 75 | from sourceSets.main.allSource |
| 76 | } |
| 77 | |
| 78 | task javadocJar(type: Jar, dependsOn:javadoc) { |
| 79 | classifier 'javadoc' |
| 80 | from javadoc.destinationDir |
| 81 | } |
| 82 | |
Tor Norbye | f6ac5e1 | 2016-09-07 12:47:35 -0700 | [diff] [blame] | 83 | task annotationsZip(type: Zip) { |
| 84 | classifier 'annotations' |
| 85 | from 'external-annotations' |
| 86 | } |
| 87 | |
| 88 | // add javadoc/source/annotations jar tasks as artifacts |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 89 | artifacts { |
| 90 | archives jar |
| 91 | archives sourcesJar |
| 92 | archives javadocJar |
Tor Norbye | f6ac5e1 | 2016-09-07 12:47:35 -0700 | [diff] [blame] | 93 | archives annotationsZip |
Tor Norbye | be61afa | 2013-11-13 09:58:36 -0800 | [diff] [blame] | 94 | } |