blob: 89796ea7f529a4449656bb8a1e7320604b0e69e9 [file] [log] [blame]
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07001apply plugin: 'com.android.library'
2archivesBaseName = 'support-core-ui'
3
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07004dependencies {
Alan Viverette9439d702016-10-25 14:45:10 +01005 compile project(':support-annotations')
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07006 compile project(':support-compat')
Aurimas Liutikasdfe75782016-08-03 14:27:20 -07007 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07008 exclude module: 'support-annotations'
9 }
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070010 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070011 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
19sourceCompatibility = JavaVersion.VERSION_1_7
20targetCompatibility = JavaVersion.VERSION_1_7
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070021
22android {
Alan Viverette9439d702016-10-25 14:45:10 +010023 compileSdkVersion project.ext.currentSdk
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070024
25 defaultConfig {
26 minSdkVersion 9
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070027 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
28 }
29
30 sourceSets {
31 main.manifest.srcFile 'AndroidManifest.xml'
Alan Viverette9439d702016-10-25 14:45:10 +010032 main.java.srcDirs = [
33 'honeycomb',
34 'ics',
35 'jellybean-mr2',
36 'api21',
37 'java'
38 ]
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070039
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 Grouchnikovff22d812016-05-11 15:24:25 -070046 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
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 exclude('android/content/pm/**')
89 exclude('android/service/media/**')
90 }
91
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070092 artifacts.add('archives', javadocJarTask);
93 artifacts.add('archives', sourcesJarTask);
94}
95
96uploadArchives {
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}