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