blob: 4baaa27fc8f815462c13f1873a37ab6dd6293643 [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -08002
3archivesBaseName = 'support-v13'
4
Justin Klaassen68e7adb2016-01-21 12:50:47 -08005sourceCompatibility = JavaVersion.VERSION_1_7
6targetCompatibility = JavaVersion.VERSION_1_7
7
Yigit Boyar3986e042016-02-08 18:31:38 -08008createApiSourceSets(project, gradle.ext.studioCompat.modules.v13.apiTargets)
9setApiModuleDependencies(project, dependencies, gradle.ext.studioCompat.modules.v13.dependencies)
Yigit Boyar5932b6f2014-04-30 13:43:59 -070010android {
11 compileSdkVersion 13
Yigit Boyar5932b6f2014-04-30 13:43:59 -070012
13 defaultConfig {
14 minSdkVersion 13
15 // TODO: get target from branch
16 //targetSdkVersion 19
17 }
18
Yigit Boyar5932b6f2014-04-30 13:43:59 -070019 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
Justin Klaassen68e7adb2016-01-21 12:50:47 -080028 compileOptions {
29 sourceCompatibility JavaVersion.VERSION_1_7
30 targetCompatibility JavaVersion.VERSION_1_7
31 }
32
Yigit Boyar5932b6f2014-04-30 13:43:59 -070033 lintOptions {
34 // TODO: fix errors and reenable.
35 abortOnError false
36 }
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080037
38 compileOptions {
39 sourceCompatibility JavaVersion.VERSION_1_7
40 targetCompatibility JavaVersion.VERSION_1_7
41 }
Yigit Boyar5932b6f2014-04-30 13:43:59 -070042}
43
44android.libraryVariants.all { variant ->
Yigit Boyar5932b6f2014-04-30 13:43:59 -070045 def name = variant.buildType.name
46
Chris Banes4efd0382015-03-05 20:04:05 +000047 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
Yigit Boyar5932b6f2014-04-30 13:43:59 -070048 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) {
Chris Banes4efd0382015-03-05 20:04:05 +000058 source android.sourceSets.main.java
Yigit Boyar5932b6f2014-04-30 13:43:59 -070059 classpath = files(variant.javaCompile.classpath.files) + files(
Chris Banes4efd0382015-03-05 20:04:05 +000060 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
Yigit Boyar5932b6f2014-04-30 13:43:59 -070061 }
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'
Chris Banes4efd0382015-03-05 20:04:05 +000070 from android.sourceSets.main.java.srcDirs
Yigit Boyar5932b6f2014-04-30 13:43:59 -070071 }
72
73 project.ext.allSS.each { ss ->
Chris Banes4efd0382015-03-05 20:04:05 +000074 javadocTask.source ss.java
75 sourcesJarTask.from ss.java.srcDirs
Yigit Boyar5932b6f2014-04-30 13:43:59 -070076 }
77
78 artifacts.add('archives', javadocJarTask);
79 artifacts.add('archives', sourcesJarTask);
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080080}
81
82uploadArchives {
83 repositories {
84 mavenDeployer {
85
Xavier Ducrohet855a9222014-01-02 19:00:43 -080086 repository(url: uri(rootProject.ext.supportRepoOut)) {
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080087 }
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}