blob: a5db437f68325e8262f363a07a2bd47814522fac [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Jaekyun Seokd2f102c2014-04-14 09:26:11 +09002
3archivesBaseName = 'recyclerview-v7'
4
5dependencies {
Yigit Boyarffff7c92014-10-08 17:24:29 -07006 compile project(':support-annotations')
Kirill Grouchnikov55fc3f22016-05-12 12:17:09 -07007 compile project(':support-compat')
8 compile project(':support-core-ui')
Aurimas Liutikasdfe75782016-08-03 14:27:20 -07009 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
Yigit Boyar999c3972015-12-29 17:37:37 -080010 exclude module: 'support-annotations'
11 }
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070012 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
Yigit Boyar999c3972015-12-29 17:37:37 -080013 exclude module: 'support-annotations'
14 }
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070015 testCompile 'junit:junit:4.12'
Yigit Boyara41c1742016-07-08 18:28:20 -070016 testCompile "org.mockito:mockito-core:1.9.5"
Yigit Boyar999c3972015-12-29 17:37:37 -080017 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 Seokd2f102c2014-04-14 09:26:11 +090020}
21
22android {
Yigit Boyarc9750a12016-01-06 17:28:55 -080023 compileSdkVersion 23
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090024
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070025 defaultConfig {
Kirill Grouchnikovdf153992016-05-04 16:55:20 -040026 minSdkVersion 9
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070027 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070028 }
29
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090030 sourceSets {
31 main.manifest.srcFile 'AndroidManifest.xml'
32 main.java.srcDir 'src'
Deepanshu Gupta281e1192016-01-18 22:07:58 -080033 main.res.srcDirs 'res', 'res-public'
Deepanshu Gupta0194ed82015-04-15 16:40:02 -070034
Yigit Boyaredc25dd2014-04-23 15:40:36 -070035 androidTest.setRoot('tests')
Yigit Boyara41c1742016-07-08 18:28:20 -070036 test.java.srcDir 'jvm-tests/src'
Yigit Boyaredc25dd2014-04-23 15:40:36 -070037 androidTest.java.srcDir 'tests/src'
Deepanshu Gupta0194ed82015-04-15 16:40:02 -070038 androidTest.res.srcDir 'tests/res'
39 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090040 }
41
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080042 compileOptions {
43 sourceCompatibility JavaVersion.VERSION_1_7
44 targetCompatibility JavaVersion.VERSION_1_7
45 }
46
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090047 lintOptions {
48 // TODO: fix errors and reenable.
49 abortOnError false
50 }
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070051
52 packagingOptions {
53 exclude 'LICENSE.txt'
54 }
55
56 testOptions {
57 unitTests.returnDefaultValues = true
58 }
Yigit Boyar9c2c2702015-12-28 14:55:35 -080059
60 buildTypes.all {
61 consumerProguardFiles 'proguard-rules.pro'
62 }
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070063}
64
65android.libraryVariants.all { variant ->
66 def name = variant.buildType.name
67
Chris Banes6a4c14b2015-03-05 20:04:05 +000068 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070069 return; // Skip debug builds.
70 }
71 def suffix = name.capitalize()
72
73 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
74 dependsOn variant.javaCompile
75 from variant.javaCompile.destinationDir
76 from 'LICENSE.txt'
77 }
78 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
Chris Banes6a4c14b2015-03-05 20:04:05 +000079 source android.sourceSets.main.java
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070080 classpath = files(variant.javaCompile.classpath.files) + files(
Chris Banes6a4c14b2015-03-05 20:04:05 +000081 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070082 }
83
84 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
85 classifier = 'javadoc'
86 from 'build/docs/javadoc'
87 }
88
89 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
90 classifier = 'sources'
Chris Banes6a4c14b2015-03-05 20:04:05 +000091 from android.sourceSets.main.java.srcDirs
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070092 }
93
94 artifacts.add('archives', javadocJarTask);
95 artifacts.add('archives', sourcesJarTask);
96}
97
98uploadArchives {
99 repositories {
100 mavenDeployer {
101 repository(url: uri(rootProject.ext.supportRepoOut)) {
102 }
103
104 pom.project {
105 name 'Android Support RecyclerView v7'
106 description "Android Support RecyclerView v7"
107 url 'http://developer.android.com/tools/extras/support-library.html'
108 inceptionYear '2011'
109
110 licenses {
111 license {
112 name 'The Apache Software License, Version 2.0'
113 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
114 distribution 'repo'
115 }
116 }
117
118 scm {
119 url "http://source.android.com"
120 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
121 }
122 developers {
123 developer {
124 name 'The Android Open Source Project'
125 }
126 }
127 }
128 }
129 }
130}