1 apply plugin: 'android-library' 2 3 archivesBaseName = 'cardview-v7' 4 5 android { 6 // WARNING: should be 7 7 compileSdkVersion 'current' 8 9 buildToolsVersion "19.0.1" 10 11 defaultConfig { 12 minSdkVersion 7 13 // TODO: get target from branch 14 //targetSdkVersion 19 15 } 16 17 sourceSets { 18 main.manifest.srcFile 'AndroidManifest.xml' 19 main.java.srcDirs = ['base', 'eclair-mr1', 'jellybean-mr1', 'api21', 'src'] 20 main.aidl.srcDirs = ['base', 'eclair-mr1', 'jellybean-mr1', 'api21', 'src'] 21 main.res.srcDirs = ['res'] 22 23 androidTest.setRoot('tests') 24 androidTest.java.srcDir 'tests/java' 25 } 26 27 lintOptions { 28 // TODO: fix errors and reenable. 29 abortOnError false 30 } 31 } 32 33 android.libraryVariants.all { variant -> 34 def name = variant.buildType.name 35 36 if (name.equals(com.android.builder.BuilderConstants.DEBUG)) { 37 return; // Skip debug builds. 38 } 39 def suffix = name.capitalize() 40 41 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ 42 dependsOn variant.javaCompile 43 from variant.javaCompile.destinationDir 44 from 'LICENSE.txt' 45 } 46 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { 47 source android.sourceSets.main.allJava 48 classpath = files(variant.javaCompile.classpath.files) + files( 49 "${android.plugin.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") 50 } 51 52 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { 53 classifier = 'javadoc' 54 from 'build/docs/javadoc' 55 } 56 57 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { 58 classifier = 'sources' 59 from android.sourceSets.main.allSource 60 } 61 62 artifacts.add('archives', javadocJarTask); 63 artifacts.add('archives', sourcesJarTask); 64 } 65 66 uploadArchives { 67 repositories { 68 mavenDeployer { 69 repository(url: uri(rootProject.ext.supportRepoOut)) { 70 } 71 72 pom.project { 73 name 'Android Support CardView v7' 74 description "Android Support CardView v7" 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