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