blob: 0a862d409ed80dd5fb9f41b27a37172562aa9cc7 [file] [log] [blame]
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07001apply plugin: 'com.android.library'
2archivesBaseName = 'support-fragment'
3
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07004dependencies {
5 compile project(':support-compat')
6 compile project(':support-media-compat')
7 compile project(':support-core-ui')
Kirill Grouchnikov5dd39aa2016-05-16 16:34:01 -07008 compile project(':support-core-utils')
Aurimas Liutikasdfe75782016-08-03 14:27:20 -07009 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070010 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}") {
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070013 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
21sourceCompatibility = JavaVersion.VERSION_1_7
22targetCompatibility = JavaVersion.VERSION_1_7
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070023
24android {
Alan Viverette9439d702016-10-25 14:45:10 +010025 compileSdkVersion project.ext.currentSdk
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070026
27 defaultConfig {
28 minSdkVersion 9
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070029
30 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
31 }
32
33 sourceSets {
34 main.manifest.srcFile 'AndroidManifest.xml'
Alan Viverette9439d702016-10-25 14:45:10 +010035 main.java.srcDirs = [
36 'gingerbread',
37 'honeycomb',
38 'jellybean',
39 'api21',
40 'java'
41 ]
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070042
43 androidTest.setRoot('tests')
44 androidTest.java.srcDir 'tests/java'
45 androidTest.res.srcDir 'tests/res'
46 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
47 }
48
49 lintOptions {
50 // TODO: fix errors and reenable.
51 abortOnError false
52 }
53
54 compileOptions {
55 sourceCompatibility JavaVersion.VERSION_1_7
56 targetCompatibility JavaVersion.VERSION_1_7
57 }
58
59 testOptions {
60 unitTests.returnDefaultValues = true
61 compileSdkVersion project.ext.currentSdk
62 }
63}
64
65android.libraryVariants.all { variant ->
66 def name = variant.buildType.name
67
68 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
69 return; // Skip debug builds.
70 }
71 def suffix = name.capitalize()
72
73 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
74 dependsOn variant.javaCompile
75 from variant.javaCompile.destinationDir
76 from 'LICENSE.txt'
77 }
78 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
79 source android.sourceSets.main.java
80 classpath = files(variant.javaCompile.classpath.files) + files(
81 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
82 }
83
84 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
85 classifier = 'javadoc'
86 from 'build/docs/javadoc'
87 }
88
89 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
90 classifier = 'sources'
91 from android.sourceSets.main.java.srcDirs
92 exclude('android/content/pm/**')
93 exclude('android/service/media/**')
94 }
95
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070096 artifacts.add('archives', javadocJarTask);
97 artifacts.add('archives', sourcesJarTask);
98}
99
100uploadArchives {
101 repositories {
102 mavenDeployer {
103 repository(url: uri(rootProject.ext.supportRepoOut)) {
104 }
105
106 pom.project {
107 name 'Android Support Library v4'
108 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."
109 url 'http://developer.android.com/tools/extras/support-library.html'
110 inceptionYear '2011'
111
112 licenses {
113 license {
114 name 'The Apache Software License, Version 2.0'
115 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
116 distribution 'repo'
117 }
118 }
119
120 scm {
121 url "http://source.android.com"
122 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
123 }
124 developers {
125 developer {
126 name 'The Android Open Source Project'
127 }
128 }
129 }
130 }
131 }
132}