blob: 76877331595bd6a2fafe8af3073e47e7208319db [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -08002
3archivesBaseName = 'appcompat-v7'
4
5dependencies {
Xavier Ducrohet855a9222014-01-02 19:00:43 -08006 compile project(':support-v4')
Chris Banese4beadb2015-11-10 10:45:58 +00007 compile project(':support-vector-drawable')
Chris Banesf6c82b62016-01-13 16:38:59 +00008 androidTestCompile ('com.android.support.test:runner:0.4.1') {
9 exclude module: 'support-annotations'
10 }
11 androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') {
12 exclude module: 'support-annotations'
13 }
Chris Banescdbdcb22015-07-10 11:05:06 +010014 testCompile 'junit:junit:4.12'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080015}
16
17android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080018 compileSdkVersion project.ext.currentSdk
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080019
Chris Banescdbdcb22015-07-10 11:05:06 +010020 defaultConfig {
21 minSdkVersion 7
22 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Chris Banes1b30ef62016-01-11 11:41:22 +000023 // This disables the builds tools automatic vector -> PNG generation
24 generatedDensities = []
Chris Banescdbdcb22015-07-10 11:05:06 +010025 }
26
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080027 sourceSets {
28 main.manifest.srcFile 'AndroidManifest.xml'
29 main.java.srcDir 'src'
Tor Norbye47c59fb2015-04-08 14:42:16 -070030 main.res.srcDirs 'res', 'res-public'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080031 main.assets.srcDir 'assets'
32 main.resources.srcDir 'src'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080033
Xavier Ducrohet020e4322014-03-18 16:41:30 -070034 androidTest.setRoot('tests')
35 androidTest.java.srcDir 'tests/src'
Chris Banescdbdcb22015-07-10 11:05:06 +010036 androidTest.res.srcDir 'tests/res'
37 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080038 }
Xavier Ducrohet61becda2014-01-29 19:02:16 -080039
Chris Banes5ba72322014-09-10 13:01:06 +010040 compileOptions {
41 sourceCompatibility JavaVersion.VERSION_1_7
42 targetCompatibility JavaVersion.VERSION_1_7
43 }
44
Chris Banese4beadb2015-11-10 10:45:58 +000045 aaptOptions {
46 additionalParameters "--no-version-vectors"
47 }
48
Xavier Ducrohet61becda2014-01-29 19:02:16 -080049 lintOptions {
50 // TODO: fix errors and reenable.
51 abortOnError false
52 }
Jeff Hamilton5d522dd2014-05-19 12:50:02 -050053}
Xavier Ducrohet11b83982015-03-31 15:12:42 -070054
55android.libraryVariants.all { variant ->
56 def name = variant.buildType.name
57
58 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
59 return; // Skip debug builds.
60 }
61 def suffix = name.capitalize()
62
63 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
64 dependsOn variant.javaCompile
65 from variant.javaCompile.destinationDir
66 from 'LICENSE.txt'
67 }
68 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
69 source android.sourceSets.main.java
70 classpath = files(variant.javaCompile.classpath.files) + files(
71 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
72 }
73
74 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
75 classifier = 'javadoc'
76 from 'build/docs/javadoc'
77 }
78
79 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
80 classifier = 'sources'
81 from android.sourceSets.main.java.srcDirs
82 }
83
84 artifacts.add('archives', javadocJarTask);
85 artifacts.add('archives', sourcesJarTask);
86}
87
88uploadArchives {
89 repositories {
90 mavenDeployer {
91 repository(url: uri(rootProject.ext.supportRepoOut)) {
92 }
93
94 pom.project {
95 name 'Android AppCompat Library v7'
96 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."
97 url 'http://developer.android.com/tools/extras/support-library.html'
98 inceptionYear '2011'
99
100 licenses {
101 license {
102 name 'The Apache Software License, Version 2.0'
103 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
104 distribution 'repo'
105 }
106 }
107
108 scm {
109 url "http://source.android.com"
110 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
111 }
112 developers {
113 developer {
114 name 'The Android Open Source Project'
115 }
116 }
117 }
118 }
119 }
120}