build.gradle revision 9697da770746866fc0152643e8eacb17a4c5af88
1apply plugin: android.support.SupportLibraryPlugin
2archivesBaseName = 'support-compat'
3
4dependencies {
5    compile project(':support-annotations')
6    androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
7        exclude module: 'support-annotations'
8    }
9    androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
10        exclude module: 'support-annotations'
11    }
12    androidTestCompile 'org.mockito:mockito-core:1.9.5'
13    androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
14    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
15    testCompile 'junit:junit:4.12'
16}
17
18android {
19    compileSdkVersion project.ext.currentSdk
20
21    defaultConfig {
22        minSdkVersion 9
23    }
24
25    sourceSets {
26        main.java.srcDirs = [
27                'gingerbread',
28                'honeycomb',
29                'honeycomb_mr1',
30                'honeycomb_mr2',
31                'ics',
32                'ics-mr1',
33                'jellybean',
34                'jellybean-mr1',
35                'jellybean-mr2',
36                'kitkat',
37                'api20',
38                'api21',
39                'api22',
40                'api23',
41                'api24',
42                'api26',
43                'java'
44        ]
45        main.aidl.srcDirs = ['java']
46    }
47}
48
49android.libraryVariants.all { variant ->
50    def name = variant.buildType.name
51
52    if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
53        return; // Skip debug builds.
54    }
55    def suffix = name.capitalize()
56
57    def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
58        classifier = 'sources'
59        from android.sourceSets.main.java.srcDirs
60        exclude('android/content/pm/**')
61        exclude('android/service/media/**')
62    }
63
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 Library compat'
75                description "The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. Compatible on devices running API 4 or later."
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}