1apply plugin: 'java' 2 3archivesBaseName = 'support-v4' 4 5sourceSets { 6 main.java.srcDir 'java' 7 eclair.java.srcDir 'eclair' 8 eclairmr1.java.srcDir 'eclair-mr1' 9 froyo.java.srcDir 'froyo' 10 gingerbread.java.srcDir 'gingerbread' 11 honeycomb.java.srcDir 'honeycomb' 12 honeycombmr2.java.srcDir 'honeycomb_mr2' 13 ics.java.srcDir 'ics' 14 icsmr1.java.srcDir 'ics-mr1' 15 jellybean.java.srcDir 'jellybean' 16 jellybeanmr1.java.srcDir 'jellybean-mr1' 17 jellybeanmr2.java.srcDir 'jellybean-mr2' 18 kitkat.java.srcDir 'kitkat' 19} 20 21dependencies { 22 eclairCompile getAndroidPrebuilt('5') 23 eclairmr1Compile getAndroidPrebuilt('7') 24 froyoCompile getAndroidPrebuilt('8') 25 gingerbreadCompile getAndroidPrebuilt('9') 26 honeycombCompile getAndroidPrebuilt('11') 27 honeycombmr2Compile getAndroidPrebuilt('13') 28 icsCompile getAndroidPrebuilt('14') 29 icsmr1Compile getAndroidPrebuilt('15') 30 jellybeanCompile getAndroidPrebuilt('16') 31 jellybeanmr1Compile getAndroidPrebuilt('17') 32 jellybeanmr2Compile getAndroidPrebuilt('18') 33 kitkatCompile getAndroidPrebuilt('19') 34 35 compile getAndroidPrebuilt('4') 36 compile sourceSets.eclair.output 37 compile sourceSets.eclairmr1.output 38 compile sourceSets.froyo.output 39 compile sourceSets.gingerbread.output 40 compile sourceSets.honeycomb.output 41 compile sourceSets.honeycombmr2.output 42 compile sourceSets.ics.output 43 compile sourceSets.icsmr1.output 44 compile sourceSets.jellybean.output 45 compile sourceSets.jellybeanmr1.output 46 compile sourceSets.jellybeanmr2.output 47 compile sourceSets.kitkat.output 48} 49 50 51jar { 52 from sourceSets.eclair.output 53 from sourceSets.eclairmr1.output 54 from sourceSets.froyo.output 55 from sourceSets.gingerbread.output 56 from sourceSets.honeycomb.output 57 from sourceSets.honeycombmr2.output 58 from sourceSets.ics.output 59 from sourceSets.icsmr1.output 60 from sourceSets.jellybean.output 61 from sourceSets.jellybeanmr1.output 62 from sourceSets.jellybeanmr2.output 63 from sourceSets.kitkat.output 64} 65 66uploadArchives { 67 repositories { 68 mavenDeployer { 69 repository(url: uri(project.parent.ext.androidRepoOut)) { 70 } 71 72 pom.project { 73 name 'Android Support Library v4' 74 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. Compatible on devices running API 4 or later." 75 url 'http://developer.android.com/tools/extras/support-library.html' 76 inceptionYear '2011' 77 78 licenses { 79 license { 80 name 'The Apache Software License, Version 2.0' 81 url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 82 distribution 'repo' 83 } 84 } 85 86 scm { 87 url "http://source.android.com" 88 connection "scm:git:https://android.googlesource.com/platform/frameworks/support" 89 } 90 developers { 91 developer { 92 name 'The Android Open Source Project' 93 } 94 } 95 } 96 } 97 } 98} 99 100// configuration for the javadoc to include all source sets. 101javadoc { 102 source sourceSets.main.allJava 103 source sourceSets.eclair.allJava 104 source sourceSets.eclairmr1.allJava 105 source sourceSets.froyo.allJava 106 source sourceSets.gingerbread.allJava 107 source sourceSets.honeycomb.allJava 108 source sourceSets.honeycombmr2.allJava 109 source sourceSets.ics.allJava 110 source sourceSets.icsmr1.allJava 111 source sourceSets.jellybean.allJava 112 source sourceSets.jellybeanmr1.allJava 113 source sourceSets.jellybeanmr2.allJava 114 source sourceSets.kitkat.allJava 115} 116 117// custom tasks for creating source/javadoc jars 118task sourcesJar(type: Jar, dependsOn:classes) { 119 classifier = 'sources' 120 from sourceSets.main.allSource 121 from sourceSets.eclair.allSource 122 from sourceSets.eclairmr1.allSource 123 from sourceSets.froyo.allSource 124 from sourceSets.gingerbread.allSource 125 from sourceSets.honeycomb.allSource 126 from sourceSets.honeycombmr2.allSource 127 from sourceSets.ics.allSource 128 from sourceSets.icsmr1.allSource 129 from sourceSets.jellybean.allSource 130 from sourceSets.jellybeanmr1.allSource 131 from sourceSets.jellybeanmr2.allSource 132 from sourceSets.kitkat.allSource 133} 134 135task javadocJar(type: Jar, dependsOn:javadoc) { 136 classifier 'javadoc' 137 from javadoc.destinationDir 138} 139 140// add javadoc/source jar tasks as artifacts 141artifacts { 142 archives jar 143 archives sourcesJar 144 archives javadocJar 145} 146