Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 1 | apply plugin: 'com.android.library' |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 2 | |
| 3 | archivesBaseName = 'appcompat-v7' |
| 4 | |
| 5 | dependencies { |
Xavier Ducrohet | 855a922 | 2014-01-02 19:00:43 -0800 | [diff] [blame] | 6 | compile project(':support-v4') |
Chris Banes | e4beadb | 2015-11-10 10:45:58 +0000 | [diff] [blame] | 7 | compile project(':support-vector-drawable') |
Chris Banes | bd3494d | 2016-01-27 18:03:37 +0000 | [diff] [blame] | 8 | compile project(':support-animated-vector-drawable') |
| 9 | |
Chris Banes | f6c82b6 | 2016-01-13 16:38:59 +0000 | [diff] [blame] | 10 | androidTestCompile ('com.android.support.test:runner:0.4.1') { |
| 11 | exclude module: 'support-annotations' |
| 12 | } |
| 13 | androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') { |
| 14 | exclude module: 'support-annotations' |
| 15 | } |
Kirill Grouchnikov | 21f78eb | 2016-02-01 16:58:36 -0500 | [diff] [blame] | 16 | androidTestCompile 'org.mockito:mockito-core:1.9.5' |
Kirill Grouchnikov | a9f4a78 | 2016-02-03 11:37:47 -0500 | [diff] [blame^] | 17 | androidTestCompile 'com.google.dexmaker:dexmaker:1.2' |
| 18 | androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' |
Chris Banes | cdbdcb2 | 2015-07-10 11:05:06 +0100 | [diff] [blame] | 19 | testCompile 'junit:junit:4.12' |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | android { |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 23 | compileSdkVersion project.ext.currentSdk |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 24 | |
Chris Banes | cdbdcb2 | 2015-07-10 11:05:06 +0100 | [diff] [blame] | 25 | defaultConfig { |
| 26 | minSdkVersion 7 |
| 27 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
Chris Banes | 1b30ef6 | 2016-01-11 11:41:22 +0000 | [diff] [blame] | 28 | // This disables the builds tools automatic vector -> PNG generation |
| 29 | generatedDensities = [] |
Chris Banes | cdbdcb2 | 2015-07-10 11:05:06 +0100 | [diff] [blame] | 30 | } |
| 31 | |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 32 | sourceSets { |
| 33 | main.manifest.srcFile 'AndroidManifest.xml' |
| 34 | main.java.srcDir 'src' |
Tor Norbye | 47c59fb | 2015-04-08 14:42:16 -0700 | [diff] [blame] | 35 | main.res.srcDirs 'res', 'res-public' |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 36 | main.assets.srcDir 'assets' |
| 37 | main.resources.srcDir 'src' |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 38 | |
Xavier Ducrohet | 020e432 | 2014-03-18 16:41:30 -0700 | [diff] [blame] | 39 | androidTest.setRoot('tests') |
| 40 | androidTest.java.srcDir 'tests/src' |
Chris Banes | cdbdcb2 | 2015-07-10 11:05:06 +0100 | [diff] [blame] | 41 | androidTest.res.srcDir 'tests/res' |
| 42 | androidTest.manifest.srcFile 'tests/AndroidManifest.xml' |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 43 | } |
Xavier Ducrohet | 61becda | 2014-01-29 19:02:16 -0800 | [diff] [blame] | 44 | |
Chris Banes | 5ba7232 | 2014-09-10 13:01:06 +0100 | [diff] [blame] | 45 | compileOptions { |
| 46 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 47 | targetCompatibility JavaVersion.VERSION_1_7 |
| 48 | } |
| 49 | |
Chris Banes | e4beadb | 2015-11-10 10:45:58 +0000 | [diff] [blame] | 50 | aaptOptions { |
| 51 | additionalParameters "--no-version-vectors" |
| 52 | } |
| 53 | |
Xavier Ducrohet | 61becda | 2014-01-29 19:02:16 -0800 | [diff] [blame] | 54 | lintOptions { |
| 55 | // TODO: fix errors and reenable. |
| 56 | abortOnError false |
| 57 | } |
Jeff Hamilton | 5d522dd | 2014-05-19 12:50:02 -0500 | [diff] [blame] | 58 | } |
Xavier Ducrohet | 11b8398 | 2015-03-31 15:12:42 -0700 | [diff] [blame] | 59 | |
| 60 | android.libraryVariants.all { variant -> |
| 61 | def name = variant.buildType.name |
| 62 | |
| 63 | if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { |
| 64 | return; // Skip debug builds. |
| 65 | } |
| 66 | def suffix = name.capitalize() |
| 67 | |
| 68 | def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ |
| 69 | dependsOn variant.javaCompile |
| 70 | from variant.javaCompile.destinationDir |
| 71 | from 'LICENSE.txt' |
| 72 | } |
| 73 | def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { |
| 74 | source android.sourceSets.main.java |
| 75 | classpath = files(variant.javaCompile.classpath.files) + files( |
| 76 | "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") |
| 77 | } |
| 78 | |
| 79 | def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { |
| 80 | classifier = 'javadoc' |
| 81 | from 'build/docs/javadoc' |
| 82 | } |
| 83 | |
| 84 | def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { |
| 85 | classifier = 'sources' |
| 86 | from android.sourceSets.main.java.srcDirs |
| 87 | } |
| 88 | |
| 89 | artifacts.add('archives', javadocJarTask); |
| 90 | artifacts.add('archives', sourcesJarTask); |
| 91 | } |
| 92 | |
| 93 | uploadArchives { |
| 94 | repositories { |
| 95 | mavenDeployer { |
| 96 | repository(url: uri(rootProject.ext.supportRepoOut)) { |
| 97 | } |
| 98 | |
| 99 | pom.project { |
| 100 | name 'Android AppCompat Library v7' |
| 101 | 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." |
| 102 | url 'http://developer.android.com/tools/extras/support-library.html' |
| 103 | inceptionYear '2011' |
| 104 | |
| 105 | licenses { |
| 106 | license { |
| 107 | name 'The Apache Software License, Version 2.0' |
| 108 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 109 | distribution 'repo' |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | scm { |
| 114 | url "http://source.android.com" |
| 115 | connection "scm:git:https://android.googlesource.com/platform/frameworks/support" |
| 116 | } |
| 117 | developers { |
| 118 | developer { |
| 119 | name 'The Android Open Source Project' |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | } |