blob: 386694da2ffb85e520f6141042b535acbe971250 [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 {
6 compile project(':support-v4')
Yigit Boyarffff7c92014-10-08 17:24:29 -07007 compile project(':support-annotations')
Yigit Boyar999c3972015-12-29 17:37:37 -08008 androidTestCompile ('com.android.support.test:runner:0.4.1') {
9 exclude module: 'support-annotations'
10 }
11 androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') {
12 exclude module: 'support-annotations'
13 }
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070014 testCompile 'junit:junit:4.12'
Yigit Boyar999c3972015-12-29 17:37:37 -080015 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"
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090018}
19
20android {
Yigit Boyarc9750a12016-01-06 17:28:55 -080021 compileSdkVersion 23
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090022
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070023 defaultConfig {
24 minSdkVersion 7
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070025 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070026 }
27
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090028 sourceSets {
29 main.manifest.srcFile 'AndroidManifest.xml'
30 main.java.srcDir 'src'
Deepanshu Gupta281e1192016-01-18 22:07:58 -080031 main.res.srcDirs 'res', 'res-public'
Deepanshu Gupta0194ed82015-04-15 16:40:02 -070032
Yigit Boyaredc25dd2014-04-23 15:40:36 -070033 androidTest.setRoot('tests')
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070034 test.java.srcDir 'jvm-tests'
Yigit Boyaredc25dd2014-04-23 15:40:36 -070035 androidTest.java.srcDir 'tests/src'
Deepanshu Gupta0194ed82015-04-15 16:40:02 -070036 androidTest.res.srcDir 'tests/res'
37 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090038 }
39
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080040 compileOptions {
41 sourceCompatibility JavaVersion.VERSION_1_7
42 targetCompatibility JavaVersion.VERSION_1_7
43 }
44
Jaekyun Seokd2f102c2014-04-14 09:26:11 +090045 lintOptions {
46 // TODO: fix errors and reenable.
47 abortOnError false
48 }
Yigit Boyarbe7a54a2015-04-07 13:23:50 -070049
50 packagingOptions {
51 exclude 'LICENSE.txt'
52 }
53
54 testOptions {
55 unitTests.returnDefaultValues = true
56 }
Yigit Boyar9c2c2702015-12-28 14:55:35 -080057
58 buildTypes.all {
59 consumerProguardFiles 'proguard-rules.pro'
60 }
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070061}
62
63android.libraryVariants.all { variant ->
64 def name = variant.buildType.name
65
Chris Banes6a4c14b2015-03-05 20:04:05 +000066 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070067 return; // Skip debug builds.
68 }
69 def suffix = name.capitalize()
70
71 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
72 dependsOn variant.javaCompile
73 from variant.javaCompile.destinationDir
74 from 'LICENSE.txt'
75 }
76 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
Chris Banes6a4c14b2015-03-05 20:04:05 +000077 source android.sourceSets.main.java
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070078 classpath = files(variant.javaCompile.classpath.files) + files(
Chris Banes6a4c14b2015-03-05 20:04:05 +000079 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070080 }
81
82 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
83 classifier = 'javadoc'
84 from 'build/docs/javadoc'
85 }
86
87 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
88 classifier = 'sources'
Chris Banes6a4c14b2015-03-05 20:04:05 +000089 from android.sourceSets.main.java.srcDirs
Xavier Ducrohet9acddc72014-05-28 22:20:01 -070090 }
91
92 artifacts.add('archives', javadocJarTask);
93 artifacts.add('archives', sourcesJarTask);
94}
95
96uploadArchives {
97 repositories {
98 mavenDeployer {
99 repository(url: uri(rootProject.ext.supportRepoOut)) {
100 }
101
102 pom.project {
103 name 'Android Support RecyclerView v7'
104 description "Android Support RecyclerView v7"
105 url 'http://developer.android.com/tools/extras/support-library.html'
106 inceptionYear '2011'
107
108 licenses {
109 license {
110 name 'The Apache Software License, Version 2.0'
111 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
112 distribution 'repo'
113 }
114 }
115
116 scm {
117 url "http://source.android.com"
118 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
119 }
120 developers {
121 developer {
122 name 'The Android Open Source Project'
123 }
124 }
125 }
126 }
127 }
128}