blob: bbb2fd170a1c0efcead6d91b6f6d83d7e1f2099b [file] [log] [blame]
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -08001apply plugin: 'android-library'
2
3archivesBaseName = 'appcompat-v7'
4
5dependencies {
Xavier Ducrohet855a9222014-01-02 19:00:43 -08006 compile project(':support-v4')
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -08007}
8
9android {
Xavier Ducrohet261f67b2014-03-21 17:11:38 -070010 compileSdkVersion 'current'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080011
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'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080018
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
Xavier Ducrohet020e4322014-03-18 16:41:30 -070022 androidTest.setRoot('tests')
23 androidTest.java.srcDir 'tests/src'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080024 }
Xavier Ducrohet61becda2014-01-29 19:02:16 -080025
Chris Banes5ba72322014-09-10 13:01:06 +010026 compileOptions {
27 sourceCompatibility JavaVersion.VERSION_1_7
28 targetCompatibility JavaVersion.VERSION_1_7
29 }
30
Xavier Ducrohet61becda2014-01-29 19:02:16 -080031 lintOptions {
32 // TODO: fix errors and reenable.
33 abortOnError false
34 }
Jeff Hamilton5d522dd2014-05-19 12:50:02 -050035}
Xavier Ducrohet11b83982015-03-31 15:12:42 -070036
37android.libraryVariants.all { variant ->
38 def name = variant.buildType.name
39
40 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
41 return; // Skip debug builds.
42 }
43 def suffix = name.capitalize()
44
45 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
46 dependsOn variant.javaCompile
47 from variant.javaCompile.destinationDir
48 from 'LICENSE.txt'
49 }
50 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
51 source android.sourceSets.main.java
52 classpath = files(variant.javaCompile.classpath.files) + files(
53 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
54 }
55
56 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
57 classifier = 'javadoc'
58 from 'build/docs/javadoc'
59 }
60
61 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
62 classifier = 'sources'
63 from android.sourceSets.main.java.srcDirs
64 }
65
66 artifacts.add('archives', javadocJarTask);
67 artifacts.add('archives', sourcesJarTask);
68}
69
70uploadArchives {
71 repositories {
72 mavenDeployer {
73 repository(url: uri(rootProject.ext.supportRepoOut)) {
74 }
75
76 pom.project {
77 name 'Android AppCompat Library v7'
78 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."
79 url 'http://developer.android.com/tools/extras/support-library.html'
80 inceptionYear '2011'
81
82 licenses {
83 license {
84 name 'The Apache Software License, Version 2.0'
85 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
86 distribution 'repo'
87 }
88 }
89
90 scm {
91 url "http://source.android.com"
92 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
93 }
94 developers {
95 developer {
96 name 'The Android Open Source Project'
97 }
98 }
99 }
100 }
101 }
102}