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