blob: 58cd944f38f0f3b5fd5f6be9da7e28882bfad647 [file] [log] [blame]
Kirill Grouchnikovff22d812016-05-11 15:24:25 -07001apply plugin: 'com.android.library'
2archivesBaseName = 'support-fragment'
3
4
5createApiSourceSets(project, gradle.ext.studioCompat.modules.fragment.apiTargets)
6dependencies {
7 compile project(':support-compat')
8 compile project(':support-media-compat')
9 compile project(':support-core-ui')
Kirill Grouchnikov5dd39aa2016-05-16 16:34:01 -070010 compile project(':support-core-utils')
Kirill Grouchnikovff22d812016-05-11 15:24:25 -070011 androidTestCompile ('com.android.support.test:runner:0.4.1') {
12 exclude module: 'support-annotations'
13 }
14 androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') {
15 exclude module: 'support-annotations'
16 }
17 androidTestCompile 'org.mockito:mockito-core:1.9.5'
18 androidTestCompile 'com.google.dexmaker:dexmaker:1.2'
19 androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.2'
20 testCompile 'junit:junit:4.12'
21}
22
23sourceCompatibility = JavaVersion.VERSION_1_7
24targetCompatibility = JavaVersion.VERSION_1_7
25setApiModuleDependencies(project, dependencies, gradle.ext.studioCompat.modules.fragment.dependencies)
26
27android {
28 compileSdkVersion 9
29
30 defaultConfig {
31 minSdkVersion 9
32 // TODO: get target from branch
33 //targetSdkVersion 19
34
35 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
36 }
37
38 sourceSets {
39 main.manifest.srcFile 'AndroidManifest.xml'
40 main.java.srcDirs = ['java']
41 main.aidl.srcDirs = ['java']
42
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
96 project.ext.allSS.each { ss ->
97 javadocTask.source ss.java
98 sourcesJarTask.from ss.java.srcDirs
99 }
100
101 artifacts.add('archives', javadocJarTask);
102 artifacts.add('archives', sourcesJarTask);
103}
104
105uploadArchives {
106 repositories {
107 mavenDeployer {
108 repository(url: uri(rootProject.ext.supportRepoOut)) {
109 }
110
111 pom.project {
112 name 'Android Support Library v4'
113 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."
114 url 'http://developer.android.com/tools/extras/support-library.html'
115 inceptionYear '2011'
116
117 licenses {
118 license {
119 name 'The Apache Software License, Version 2.0'
120 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
121 distribution 'repo'
122 }
123 }
124
125 scm {
126 url "http://source.android.com"
127 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
128 }
129 developers {
130 developer {
131 name 'The Android Open Source Project'
132 }
133 }
134 }
135 }
136 }
137}