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