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