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