blob: 26e9f1c38908221e525034090bbed2944703e948 [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
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070049 compileOptions {
50 sourceCompatibility JavaVersion.VERSION_1_7
51 targetCompatibility JavaVersion.VERSION_1_7
52 }
53
54 testOptions {
55 unitTests.returnDefaultValues = true
56 compileSdkVersion project.ext.currentSdk
57 }
58}
59
60android.libraryVariants.all { variant ->
61 def name = variant.buildType.name
62
63 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
64 return; // Skip debug builds.
65 }
66 def suffix = name.capitalize()
67
68 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
69 dependsOn variant.javaCompile
70 from variant.javaCompile.destinationDir
71 from 'LICENSE.txt'
72 }
73 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
74 source android.sourceSets.main.java
75 classpath = files(variant.javaCompile.classpath.files) + files(
76 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
77 }
78
79 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
80 classifier = 'javadoc'
81 from 'build/docs/javadoc'
82 }
83
84 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
85 classifier = 'sources'
86 from android.sourceSets.main.java.srcDirs
87 exclude('android/content/pm/**')
88 exclude('android/service/media/**')
89 }
90
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070091 artifacts.add('archives', javadocJarTask);
92 artifacts.add('archives', sourcesJarTask);
93}
94
95uploadArchives {
96 repositories {
97 mavenDeployer {
98 repository(url: uri(rootProject.ext.supportRepoOut)) {
99 }
100
101 pom.project {
102 name 'Android Support Library v4'
103 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."
104 url 'http://developer.android.com/tools/extras/support-library.html'
105 inceptionYear '2011'
106
107 licenses {
108 license {
109 name 'The Apache Software License, Version 2.0'
110 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
111 distribution 'repo'
112 }
113 }
114
115 scm {
116 url "http://source.android.com"
117 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
118 }
119 developers {
120 developer {
121 name 'The Android Open Source Project'
122 }
123 }
124 }
125 }
126 }
127}