blob: f5befa7b6739d95ec5a3de4e6165651ac95914a0 [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Xavier Ducrohet9cfef192014-06-17 11:58:53 -07002archivesBaseName = 'leanback-v17'
Jaekyun Seokbc734092014-04-10 08:12:34 +09003
4dependencies {
Dake Gu5738b992016-10-06 15:09:24 -07005 compile project(':support-compat')
6 compile project(':support-core-ui')
7 compile project(':support-media-compat')
8 compile project(':support-fragment')
Jaekyun Seokbc734092014-04-10 08:12:34 +09009 compile project(':support-recyclerview-v7')
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070010 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
susnata7d7bf952016-06-06 16:21:50 -070011 exclude module: 'support-annotations'
12 }
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070013 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
susnata7d7bf952016-06-06 16:21:50 -070014 exclude module: 'support-annotations'
15 }
16 testCompile 'junit:junit:4.12'
susnatab3756c52016-06-08 14:34:41 -070017 androidTestCompile "org.mockito:mockito-core:1.9.5"
18 androidTestCompile "com.google.dexmaker:dexmaker:1.2"
19 androidTestCompile "com.google.dexmaker:dexmaker-mockito:1.2"
Jaekyun Seokbc734092014-04-10 08:12:34 +090020}
21
22android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080023 compileSdkVersion project.ext.currentSdk
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070024
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070025 defaultConfig {
26 minSdkVersion 17
susnata7d7bf952016-06-06 16:21:50 -070027 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070028 }
29
Jaekyun Seokbc734092014-04-10 08:12:34 +090030 sourceSets {
31 main.manifest.srcFile 'AndroidManifest.xml'
Alan Viverette9439d702016-10-25 14:45:10 +010032 main.java.srcDirs = [
33 'common',
34 'jbmr2',
35 'kitkat',
36 'api21',
37 'api23',
38 'src'
39 ]
40 main.res.srcDir 'res'
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070041
42 androidTest.setRoot('tests')
43 androidTest.java.srcDir 'tests/java'
susnata7d7bf952016-06-06 16:21:50 -070044 androidTest.res.srcDir 'tests/res'
45 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Jaekyun Seokbc734092014-04-10 08:12:34 +090046 }
47
Alan Viveretteaf6b2512016-11-16 17:33:10 -050048 lintOptions {
49 // Remove this once all NewApi breakages have been fixed.
50 disable "NewApi"
51 }
52
Tony Mantler27a731e2015-03-16 15:58:25 -070053 compileOptions {
54 sourceCompatibility JavaVersion.VERSION_1_7
55 targetCompatibility JavaVersion.VERSION_1_7
56 }
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070057}
58
59android.libraryVariants.all { variant ->
60 def name = variant.buildType.name
61
Chris Banes4efd0382015-03-05 20:04:05 +000062 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070063 return; // Skip debug builds.
64 }
65 def suffix = name.capitalize()
66
67 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
68 dependsOn variant.javaCompile
69 from variant.javaCompile.destinationDir
70 from 'LICENSE.txt'
71 }
72 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
Chris Banes4efd0382015-03-05 20:04:05 +000073 source android.sourceSets.main.java
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070074 classpath = files(variant.javaCompile.classpath.files) + files(
Chris Banes4efd0382015-03-05 20:04:05 +000075 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070076 }
77
78 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
79 classifier = 'javadoc'
80 from 'build/docs/javadoc'
81 }
82
83 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
84 classifier = 'sources'
Chris Banes4efd0382015-03-05 20:04:05 +000085 from android.sourceSets.main.java.srcDirs
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070086 }
87
88 artifacts.add('archives', javadocJarTask);
89 artifacts.add('archives', sourcesJarTask);
90}
91
92uploadArchives {
93 repositories {
94 mavenDeployer {
95 repository(url: uri(rootProject.ext.supportRepoOut)) {
96 }
97
98 pom.project {
99 name 'Android Support Leanback v17'
100 description "Android Support Leanback v17"
101 url 'http://developer.android.com/tools/extras/support-library.html'
102 inceptionYear '2011'
103
104 licenses {
105 license {
106 name 'The Apache Software License, Version 2.0'
107 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
108 distribution 'repo'
109 }
110 }
111
112 scm {
113 url "http://source.android.com"
114 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
115 }
116 developers {
117 developer {
118 name 'The Android Open Source Project'
119 }
120 }
121 }
122 }
123 }
124}