blob: e6bb42b4a43866b74199dc73f2fca89c4411e901 [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 {
Alan Viverette9439d702016-10-25 14:45:10 +01006 compile project(':support-annotations')
Xavier Ducrohet855a9222014-01-02 19:00:43 -08007 compile project(':support-v4')
Chris Banese4beadb2015-11-10 10:45:58 +00008 compile project(':support-vector-drawable')
Chris Banesbd3494d2016-01-27 18:03:37 +00009 compile project(':support-animated-vector-drawable')
10
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070011 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
Chris Banesf6c82b62016-01-13 16:38:59 +000012 exclude module: 'support-annotations'
13 }
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070014 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
Chris Banesf6c82b62016-01-13 16:38:59 +000015 exclude module: 'support-annotations'
16 }
Kirill Grouchnikov21f78eb2016-02-01 16:58:36 -050017 androidTestCompile 'org.mockito:mockito-core:1.9.5'
Kirill Grouchnikova9f4a782016-02-03 11:37:47 -050018 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
19 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
Chris Banescdbdcb22015-07-10 11:05:06 +010020 testCompile 'junit:junit:4.12'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080021}
22
23android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080024 compileSdkVersion project.ext.currentSdk
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080025
Chris Banescdbdcb22015-07-10 11:05:06 +010026 defaultConfig {
Kirill Grouchnikovdf153992016-05-04 16:55:20 -040027 minSdkVersion 9
Chris Banescdbdcb22015-07-10 11:05:06 +010028 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Alan Viveretteeb648622016-03-11 19:33:03 +000029 // This disables the builds tools automatic vector -> PNG generation
30 generatedDensities = []
Chris Banescdbdcb22015-07-10 11:05:06 +010031 }
32
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080033 sourceSets {
34 main.manifest.srcFile 'AndroidManifest.xml'
35 main.java.srcDir 'src'
Tor Norbye47c59fb2015-04-08 14:42:16 -070036 main.res.srcDirs 'res', 'res-public'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080037 main.assets.srcDir 'assets'
38 main.resources.srcDir 'src'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080039
Xavier Ducrohet020e4322014-03-18 16:41:30 -070040 androidTest.setRoot('tests')
41 androidTest.java.srcDir 'tests/src'
Chris Banescdbdcb22015-07-10 11:05:06 +010042 androidTest.res.srcDir 'tests/res'
43 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080044 }
Xavier Ducrohet61becda2014-01-29 19:02:16 -080045
Chris Banes5ba72322014-09-10 13:01:06 +010046 compileOptions {
47 sourceCompatibility JavaVersion.VERSION_1_7
48 targetCompatibility JavaVersion.VERSION_1_7
49 }
50
Alan Viveretteeb648622016-03-11 19:33:03 +000051 aaptOptions {
52 additionalParameters "--no-version-vectors"
53 }
54
Xavier Ducrohet61becda2014-01-29 19:02:16 -080055 lintOptions {
56 // TODO: fix errors and reenable.
57 abortOnError false
58 }
Jeff Hamilton5d522dd2014-05-19 12:50:02 -050059}
Xavier Ducrohet11b83982015-03-31 15:12:42 -070060
61android.libraryVariants.all { variant ->
62 def name = variant.buildType.name
63
64 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
65 return; // Skip debug builds.
66 }
67 def suffix = name.capitalize()
68
69 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
70 dependsOn variant.javaCompile
71 from variant.javaCompile.destinationDir
72 from 'LICENSE.txt'
73 }
74 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
75 source android.sourceSets.main.java
76 classpath = files(variant.javaCompile.classpath.files) + files(
77 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
78 }
79
80 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
81 classifier = 'javadoc'
82 from 'build/docs/javadoc'
83 }
84
85 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
86 classifier = 'sources'
87 from android.sourceSets.main.java.srcDirs
88 }
89
90 artifacts.add('archives', javadocJarTask);
91 artifacts.add('archives', sourcesJarTask);
92}
93
94uploadArchives {
95 repositories {
96 mavenDeployer {
97 repository(url: uri(rootProject.ext.supportRepoOut)) {
98 }
99
100 pom.project {
101 name 'Android AppCompat Library v7'
102 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."
103 url 'http://developer.android.com/tools/extras/support-library.html'
104 inceptionYear '2011'
105
106 licenses {
107 license {
108 name 'The Apache Software License, Version 2.0'
109 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
110 distribution 'repo'
111 }
112 }
113
114 scm {
115 url "http://source.android.com"
116 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
117 }
118 developers {
119 developer {
120 name 'The Android Open Source Project'
121 }
122 }
123 }
124 }
125 }
126}