1apply plugin: 'android-library' 2 3archivesBaseName = 'recyclerview-v7' 4 5dependencies { 6 compile project(':support-v4') 7 compile project(':support-annotations') 8 androidTestCompile 'com.android.support.test:testing-support-lib:0.1' 9 androidTestCompile 'com.android.support.test.espresso:espresso-core:2.0' 10 testCompile 'junit:junit:4.12' 11} 12 13android { 14 compileSdkVersion 21 15 buildToolsVersion "19.1.0" 16 17 defaultConfig { 18 minSdkVersion 7 19 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 20 } 21 22 sourceSets { 23 main.manifest.srcFile 'AndroidManifest.xml' 24 main.java.srcDir 'src' 25 main.res.srcDir 'res' 26 27 androidTest.setRoot('tests') 28 test.java.srcDir 'jvm-tests' 29 androidTest.java.srcDir 'tests/src' 30 androidTest.res.srcDir 'tests/res' 31 androidTest.manifest.srcFile 'tests/AndroidManifest.xml' 32 } 33 34 lintOptions { 35 // TODO: fix errors and reenable. 36 abortOnError false 37 } 38 39 packagingOptions { 40 exclude 'LICENSE.txt' 41 } 42 43 testOptions { 44 unitTests.returnDefaultValues = true 45 } 46} 47 48android.libraryVariants.all { variant -> 49 def name = variant.buildType.name 50 51 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { 52 return; // Skip debug builds. 53 } 54 def suffix = name.capitalize() 55 56 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ 57 dependsOn variant.javaCompile 58 from variant.javaCompile.destinationDir 59 from 'LICENSE.txt' 60 } 61 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { 62 source android.sourceSets.main.java 63 classpath = files(variant.javaCompile.classpath.files) + files( 64 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") 65 } 66 67 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { 68 classifier = 'javadoc' 69 from 'build/docs/javadoc' 70 } 71 72 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { 73 classifier = 'sources' 74 from android.sourceSets.main.java.srcDirs 75 } 76 77 artifacts.add('archives', javadocJarTask); 78 artifacts.add('archives', sourcesJarTask); 79} 80 81uploadArchives { 82 repositories { 83 mavenDeployer { 84 repository(url: uri(rootProject.ext.supportRepoOut)) { 85 } 86 87 pom.project { 88 name 'Android Support RecyclerView v7' 89 description "Android Support RecyclerView v7" 90 url 'http://developer.android.com/tools/extras/support-library.html' 91 inceptionYear '2011' 92 93 licenses { 94 license { 95 name 'The Apache Software License, Version 2.0' 96 url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 97 distribution 'repo' 98 } 99 } 100 101 scm { 102 url "http://source.android.com" 103 connection "scm:git:https://android.googlesource.com/platform/frameworks/support" 104 } 105 developers { 106 developer { 107 name 'The Android Open Source Project' 108 } 109 } 110 } 111 } 112 } 113} 114