1apply plugin: 'com.android.library'
2
3archivesBaseName = 'animated-vector-drawable'
4
5dependencies {
6    compile project(':support-vector-drawable')
7    androidTestCompile ('com.android.support.test:runner:0.4.1') {
8        exclude module: 'support-annotations'
9    }
10    androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') {
11        exclude module: 'support-annotations'
12    }
13    testCompile 'junit:junit:4.12'
14}
15
16android {
17    compileSdkVersion 23
18    defaultConfig {
19        minSdkVersion 11
20        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21        // This disables the builds tools automatic vector -> PNG generation
22        generatedDensities = []
23    }
24
25    sourceSets {
26        main.manifest.srcFile 'AndroidManifest.xml'
27        main.java.srcDir 'src'
28
29        androidTest.setRoot('tests')
30        androidTest.java.srcDir 'tests/src'
31        androidTest.res.srcDir 'tests/res'
32        androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
33    }
34
35    compileOptions {
36        sourceCompatibility JavaVersion.VERSION_1_7
37        targetCompatibility JavaVersion.VERSION_1_7
38    }
39
40    lintOptions {
41        abortOnError true
42    }
43
44    aaptOptions {
45        additionalParameters "--no-version-vectors"
46    }
47
48    packagingOptions {
49        exclude 'LICENSE.txt'
50    }
51
52    testOptions {
53        unitTests.returnDefaultValues = true
54    }
55}
56
57android.libraryVariants.all { variant ->
58    def name = variant.buildType.name
59
60    if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
61        return; // Skip debug builds.
62    }
63    def suffix = name.capitalize()
64
65    def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar) {
66        dependsOn variant.javaCompile
67        from variant.javaCompile.destinationDir
68        from 'LICENSE.txt'
69    }
70    def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
71        source android.sourceSets.main.java
72        classpath = files(variant.javaCompile.classpath.files) + files(
73                "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
74    }
75
76    def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
77        classifier = 'javadoc'
78        from 'build/docs/javadoc'
79    }
80
81    def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
82        classifier = 'sources'
83        from android.sourceSets.main.java.srcDirs
84    }
85
86    artifacts.add('archives', javadocJarTask);
87    artifacts.add('archives', sourcesJarTask);
88}
89
90uploadArchives {
91    repositories {
92        mavenDeployer {
93            repository(url: uri(rootProject.ext.supportRepoOut)) {
94            }
95
96            pom.project {
97                name 'Android Support AnimatedVectorDrawable'
98                description "Android Support AnimatedVectorDrawable"
99                url 'http://developer.android.com/tools/extras/support-library.html'
100                inceptionYear '2015'
101
102                licenses {
103                    license {
104                        name 'The Apache Software License, Version 2.0'
105                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
106                        distribution 'repo'
107                    }
108                }
109
110                scm {
111                    url "http://source.android.com"
112                    connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
113                }
114                developers {
115                    developer {
116                        name 'The Android Open Source Project'
117                    }
118                }
119            }
120        }
121    }
122}
123