Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 1 | apply plugin: 'com.android.library' |
| 2 | archivesBaseName = 'support-core-ui' |
| 3 | |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 4 | dependencies { |
Alan Viverette | 9439d70 | 2016-10-25 14:45:10 +0100 | [diff] [blame] | 5 | compile project(':support-annotations') |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 6 | compile project(':support-compat') |
Aurimas Liutikas | dfe7578 | 2016-08-03 14:27:20 -0700 | [diff] [blame] | 7 | androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") { |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 8 | exclude module: 'support-annotations' |
| 9 | } |
Aurimas Liutikas | dfe7578 | 2016-08-03 14:27:20 -0700 | [diff] [blame] | 10 | androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") { |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 11 | exclude module: 'support-annotations' |
| 12 | } |
| 13 | androidTestCompile 'org.mockito:mockito-core:1.9.5' |
| 14 | androidTestCompile 'com.google.dexmaker:dexmaker:1.2' |
| 15 | androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2' |
| 16 | testCompile 'junit:junit:4.12' |
| 17 | } |
| 18 | |
| 19 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 20 | targetCompatibility = JavaVersion.VERSION_1_7 |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 21 | |
| 22 | android { |
Alan Viverette | 9439d70 | 2016-10-25 14:45:10 +0100 | [diff] [blame] | 23 | compileSdkVersion project.ext.currentSdk |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 24 | |
| 25 | defaultConfig { |
| 26 | minSdkVersion 9 |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 27 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 28 | } |
| 29 | |
| 30 | sourceSets { |
| 31 | main.manifest.srcFile 'AndroidManifest.xml' |
Alan Viverette | 9439d70 | 2016-10-25 14:45:10 +0100 | [diff] [blame] | 32 | main.java.srcDirs = [ |
| 33 | 'honeycomb', |
| 34 | 'ics', |
| 35 | 'jellybean-mr2', |
| 36 | 'api21', |
| 37 | 'java' |
| 38 | ] |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 39 | |
| 40 | androidTest.setRoot('tests') |
| 41 | androidTest.java.srcDir 'tests/java' |
| 42 | androidTest.res.srcDir 'tests/res' |
| 43 | androidTest.manifest.srcFile 'tests/AndroidManifest.xml' |
| 44 | } |
| 45 | |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 46 | buildTypes.all { |
| 47 | consumerProguardFiles 'proguard-rules.pro' |
| 48 | } |
| 49 | |
| 50 | compileOptions { |
| 51 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 52 | targetCompatibility JavaVersion.VERSION_1_7 |
| 53 | } |
| 54 | |
| 55 | testOptions { |
| 56 | unitTests.returnDefaultValues = true |
| 57 | compileSdkVersion project.ext.currentSdk |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | android.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 | exclude('android/content/pm/**') |
| 89 | exclude('android/service/media/**') |
| 90 | } |
| 91 | |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 92 | artifacts.add('archives', javadocJarTask); |
| 93 | artifacts.add('archives', sourcesJarTask); |
| 94 | } |
| 95 | |
| 96 | uploadArchives { |
| 97 | repositories { |
| 98 | mavenDeployer { |
| 99 | repository(url: uri(rootProject.ext.supportRepoOut)) { |
| 100 | } |
| 101 | |
| 102 | pom.project { |
| 103 | name 'Android Support Library v4' |
| 104 | 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." |
| 105 | url 'http://developer.android.com/tools/extras/support-library.html' |
| 106 | inceptionYear '2011' |
| 107 | |
| 108 | licenses { |
| 109 | license { |
| 110 | name 'The Apache Software License, Version 2.0' |
| 111 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 112 | distribution 'repo' |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | scm { |
| 117 | url "http://source.android.com" |
| 118 | connection "scm:git:https://android.googlesource.com/platform/frameworks/support" |
| 119 | } |
| 120 | developers { |
| 121 | developer { |
| 122 | name 'The Android Open Source Project' |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | } |
| 127 | } |
| 128 | } |