blob: 4d4e96f61bb03ed8fb57f2451e3a77a1caf353c9 [file] [log] [blame]
Yuichi Arakic876cd82016-02-05 14:39:00 +09001apply plugin: 'com.android.library'
2
3archivesBaseName = 'transition'
4
5dependencies {
Alan Viverette9439d702016-10-25 14:45:10 +01006 compile project(':support-annotations')
7 compile project(':support-v4')
Yuichi Arakic876cd82016-02-05 14:39:00 +09008
Aurimas Liutikasdfe75782016-08-03 14:27:20 -07009 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
Yuichi Arakic876cd82016-02-05 14:39:00 +090010 exclude module: 'support-annotations'
11 }
Aurimas Liutikasdfe75782016-08-03 14:27:20 -070012 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
Yuichi Arakic876cd82016-02-05 14:39:00 +090013 exclude module: 'support-annotations'
14 }
15 androidTestCompile 'org.mockito:mockito-core:1.9.5'
16 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
17 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
18 testCompile 'junit:junit:4.12'
19}
20
21android {
22 compileSdkVersion project.ext.currentSdk
23
24 defaultConfig {
25 minSdkVersion 14
26 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
27 }
28
29 sourceSets {
30 main.manifest.srcFile 'AndroidManifest.xml'
Alan Viverette9439d702016-10-25 14:45:10 +010031 main.java.srcDirs = [
32 'base',
33 'ics',
34 'kitkat',
35 'api21',
36 'api23',
37 'src'
38 ]
39 main.res.srcDirs = [
40 'res',
41 'res-public'
42 ]
Yuichi Arakic876cd82016-02-05 14:39:00 +090043
44 androidTest.setRoot('tests')
45 androidTest.java.srcDir 'tests/src'
46 androidTest.res.srcDir 'tests/res'
47 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
48 }
49
50 compileOptions {
51 sourceCompatibility JavaVersion.VERSION_1_7
52 targetCompatibility JavaVersion.VERSION_1_7
53 }
54
55 lintOptions {
56 // TODO: fix errors and reenable.
57 abortOnError false
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 }
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 Transition Support Library'
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}
127