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