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