Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame^] | 1 | apply plugin: 'com.android.library' |
Jaekyun Seok | d2f102c | 2014-04-14 09:26:11 +0900 | [diff] [blame] | 2 | |
| 3 | archivesBaseName = 'recyclerview-v7' |
| 4 | |
| 5 | dependencies { |
| 6 | compile project(':support-v4') |
Yigit Boyar | ffff7c9 | 2014-10-08 17:24:29 -0700 | [diff] [blame] | 7 | compile project(':support-annotations') |
Yigit Boyar | 999c397 | 2015-12-29 17:37:37 -0800 | [diff] [blame] | 8 | 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 Boyar | be7a54a | 2015-04-07 13:23:50 -0700 | [diff] [blame] | 14 | testCompile 'junit:junit:4.12' |
Yigit Boyar | 999c397 | 2015-12-29 17:37:37 -0800 | [diff] [blame] | 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" |
Jaekyun Seok | d2f102c | 2014-04-14 09:26:11 +0900 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | android { |
Yigit Boyar | c9750a1 | 2016-01-06 17:28:55 -0800 | [diff] [blame] | 21 | compileSdkVersion 23 |
Jaekyun Seok | d2f102c | 2014-04-14 09:26:11 +0900 | [diff] [blame] | 22 | |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 23 | defaultConfig { |
| 24 | minSdkVersion 7 |
Yigit Boyar | be7a54a | 2015-04-07 13:23:50 -0700 | [diff] [blame] | 25 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 26 | } |
| 27 | |
Jaekyun Seok | d2f102c | 2014-04-14 09:26:11 +0900 | [diff] [blame] | 28 | sourceSets { |
| 29 | main.manifest.srcFile 'AndroidManifest.xml' |
| 30 | main.java.srcDir 'src' |
Deepanshu Gupta | 281e119 | 2016-01-18 22:07:58 -0800 | [diff] [blame] | 31 | main.res.srcDirs 'res', 'res-public' |
Deepanshu Gupta | 0194ed8 | 2015-04-15 16:40:02 -0700 | [diff] [blame] | 32 | |
Yigit Boyar | edc25dd | 2014-04-23 15:40:36 -0700 | [diff] [blame] | 33 | androidTest.setRoot('tests') |
Yigit Boyar | be7a54a | 2015-04-07 13:23:50 -0700 | [diff] [blame] | 34 | test.java.srcDir 'jvm-tests' |
Yigit Boyar | edc25dd | 2014-04-23 15:40:36 -0700 | [diff] [blame] | 35 | androidTest.java.srcDir 'tests/src' |
Deepanshu Gupta | 0194ed8 | 2015-04-15 16:40:02 -0700 | [diff] [blame] | 36 | androidTest.res.srcDir 'tests/res' |
| 37 | androidTest.manifest.srcFile 'tests/AndroidManifest.xml' |
Jaekyun Seok | d2f102c | 2014-04-14 09:26:11 +0900 | [diff] [blame] | 38 | } |
| 39 | |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame^] | 40 | compileOptions { |
| 41 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 42 | targetCompatibility JavaVersion.VERSION_1_7 |
| 43 | } |
| 44 | |
Jaekyun Seok | d2f102c | 2014-04-14 09:26:11 +0900 | [diff] [blame] | 45 | lintOptions { |
| 46 | // TODO: fix errors and reenable. |
| 47 | abortOnError false |
| 48 | } |
Yigit Boyar | be7a54a | 2015-04-07 13:23:50 -0700 | [diff] [blame] | 49 | |
| 50 | packagingOptions { |
| 51 | exclude 'LICENSE.txt' |
| 52 | } |
| 53 | |
| 54 | testOptions { |
| 55 | unitTests.returnDefaultValues = true |
| 56 | } |
Yigit Boyar | 9c2c270 | 2015-12-28 14:55:35 -0800 | [diff] [blame] | 57 | |
| 58 | buildTypes.all { |
| 59 | consumerProguardFiles 'proguard-rules.pro' |
| 60 | } |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | android.libraryVariants.all { variant -> |
| 64 | def name = variant.buildType.name |
| 65 | |
Chris Banes | 6a4c14b | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 66 | if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 67 | 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 Banes | 6a4c14b | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 77 | source android.sourceSets.main.java |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 78 | classpath = files(variant.javaCompile.classpath.files) + files( |
Chris Banes | 6a4c14b | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 79 | "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 80 | } |
| 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 Banes | 6a4c14b | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 89 | from android.sourceSets.main.java.srcDirs |
Xavier Ducrohet | 9acddc7 | 2014-05-28 22:20:01 -0700 | [diff] [blame] | 90 | } |
| 91 | |
| 92 | artifacts.add('archives', javadocJarTask); |
| 93 | artifacts.add('archives', sourcesJarTask); |
| 94 | } |
| 95 | |
| 96 | uploadArchives { |
| 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 | } |