build.gradle revision 94d018afe59c7a3b13d1c5736436ac391860ea6e
1apply plugin: 'com.android.library' 2archivesBaseName = 'support-compat' 3 4dependencies { 5 compile project(':support-annotations') 6 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") { 7 exclude module: 'support-annotations' 8 } 9 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") { 10 exclude module: 'support-annotations' 11 } 12 androidTestCompile 'org.mockito:mockito-core:1.9.5' 13 androidTestCompile 'com.google.dexmaker:dexmaker:1.2' 14 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' 15 testCompile 'junit:junit:4.12' 16} 17 18android { 19 compileSdkVersion project.ext.currentSdk 20 21 defaultConfig { 22 minSdkVersion 9 23 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 24 } 25 26 sourceSets { 27 main.manifest.srcFile 'AndroidManifest.xml' 28 main.java.srcDirs = [ 29 'gingerbread', 30 'honeycomb', 31 'honeycomb_mr1', 32 'honeycomb_mr2', 33 'ics', 34 'ics-mr1', 35 'jellybean', 36 'jellybean-mr1', 37 'jellybean-mr2', 38 'kitkat', 39 'api20', 40 'api21', 41 'api22', 42 'api23', 43 'api24', 44 'java' 45 ] 46 main.aidl.srcDirs = ['java'] 47 48 androidTest.setRoot('tests') 49 androidTest.java.srcDir 'tests/java' 50 androidTest.res.srcDir 'tests/res' 51 androidTest.manifest.srcFile 'tests/AndroidManifest.xml' 52 } 53 54 compileOptions { 55 sourceCompatibility JavaVersion.VERSION_1_7 56 targetCompatibility JavaVersion.VERSION_1_7 57 } 58 compileSdkVersion project.ext.currentSdk 59} 60 61android.libraryVariants.all { variant -> 62 def name = variant.buildType.name 63 64 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { 65 return; // Skip debug builds. 66 } 67 def suffix = name.capitalize() 68 69 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { 70 classifier = 'sources' 71 from android.sourceSets.main.java.srcDirs 72 exclude('android/content/pm/**') 73 exclude('android/service/media/**') 74 } 75 76 artifacts.add('archives', sourcesJarTask); 77} 78 79uploadArchives { 80 repositories { 81 mavenDeployer { 82 repository(url: uri(rootProject.ext.supportRepoOut)) { 83 } 84 85 pom.project { 86 name 'Android Support Library compat' 87 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." 88 url 'http://developer.android.com/tools/extras/support-library.html' 89 inceptionYear '2011' 90 91 licenses { 92 license { 93 name 'The Apache Software License, Version 2.0' 94 url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 95 distribution 'repo' 96 } 97 } 98 99 scm { 100 url "http://source.android.com" 101 connection "scm:git:https://android.googlesource.com/platform/frameworks/support" 102 } 103 developers { 104 developer { 105 name 'The Android Open Source Project' 106 } 107 } 108 } 109 } 110 } 111}