• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1apply plugin: 'com.android.library'
2
3archivesBaseName = 'support-v13'
4
5sourceCompatibility = JavaVersion.VERSION_1_7
6targetCompatibility = JavaVersion.VERSION_1_7
7
8createApiSourceSets(project, gradle.ext.studioCompat.modules.v13.apiTargets)
9setApiModuleDependencies(project, dependencies, gradle.ext.studioCompat.modules.v13.dependencies)
10android {
11    compileSdkVersion 13
12
13    defaultConfig {
14        minSdkVersion 13
15        // TODO: get target from branch
16        //targetSdkVersion 19
17    }
18
19    sourceSets {
20        main.manifest.srcFile 'AndroidManifest.xml'
21        main.java.srcDirs = ['java']
22        main.aidl.srcDirs = ['java']
23
24        androidTest.setRoot('tests')
25        androidTest.java.srcDir 'tests/java'
26    }
27
28    compileOptions {
29        sourceCompatibility JavaVersion.VERSION_1_7
30        targetCompatibility JavaVersion.VERSION_1_7
31    }
32
33    lintOptions {
34        // TODO: fix errors and reenable.
35        abortOnError false
36    }
37
38    compileOptions {
39        sourceCompatibility JavaVersion.VERSION_1_7
40        targetCompatibility JavaVersion.VERSION_1_7
41    }
42}
43
44android.libraryVariants.all { variant ->
45    def name = variant.buildType.name
46
47    if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
48        return; // Skip debug builds.
49    }
50    def suffix = name.capitalize()
51
52    def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
53        dependsOn variant.javaCompile
54        from variant.javaCompile.destinationDir
55        from 'LICENSE.txt'
56    }
57    def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
58        source android.sourceSets.main.java
59        classpath = files(variant.javaCompile.classpath.files) + files(
60                "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
61    }
62
63    def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
64        classifier = 'javadoc'
65        from 'build/docs/javadoc'
66    }
67
68    def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
69        classifier = 'sources'
70        from android.sourceSets.main.java.srcDirs
71    }
72
73    project.ext.allSS.each { ss ->
74        javadocTask.source ss.java
75        sourcesJarTask.from ss.java.srcDirs
76    }
77
78    artifacts.add('archives', javadocJarTask);
79    artifacts.add('archives', sourcesJarTask);
80}
81
82uploadArchives {
83    repositories {
84        mavenDeployer {
85
86            repository(url: uri(rootProject.ext.supportRepoOut)) {
87            }
88
89            pom.project {
90                name 'Android Support Library v13'
91                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 13 or later."
92                url 'http://developer.android.com/tools/extras/support-library.html'
93                inceptionYear '2011'
94
95                licenses {
96                    license {
97                        name 'The Apache Software License, Version 2.0'
98                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
99                        distribution 'repo'
100                    }
101                }
102
103                scm {
104                    url "http://source.android.com"
105                    connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
106                }
107                developers {
108                    developer {
109                        name 'The Android Open Source Project'
110                    }
111                }
112            }
113        }
114    }
115}
116