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