Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 1 | apply plugin: 'com.android.library' |
| 2 | archivesBaseName = 'support-fragment' |
| 3 | |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 4 | dependencies { |
| 5 | compile project(':support-compat') |
| 6 | compile project(':support-media-compat') |
| 7 | compile project(':support-core-ui') |
Kirill Grouchnikov | 5dd39aa | 2016-05-16 16:34:01 -0700 | [diff] [blame] | 8 | compile project(':support-core-utils') |
Aurimas Liutikas | dfe7578 | 2016-08-03 14:27:20 -0700 | [diff] [blame] | 9 | androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") { |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 10 | exclude module: 'support-annotations' |
| 11 | } |
Aurimas Liutikas | dfe7578 | 2016-08-03 14:27:20 -0700 | [diff] [blame] | 12 | androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") { |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 13 | 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 | |
| 21 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 22 | targetCompatibility = JavaVersion.VERSION_1_7 |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 23 | |
| 24 | android { |
Alan Viverette | 9439d70 | 2016-10-25 14:45:10 +0100 | [diff] [blame] | 25 | compileSdkVersion project.ext.currentSdk |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 26 | |
| 27 | defaultConfig { |
| 28 | minSdkVersion 9 |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 29 | |
| 30 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 31 | } |
| 32 | |
| 33 | sourceSets { |
| 34 | main.manifest.srcFile 'AndroidManifest.xml' |
Alan Viverette | 9439d70 | 2016-10-25 14:45:10 +0100 | [diff] [blame] | 35 | main.java.srcDirs = [ |
| 36 | 'gingerbread', |
| 37 | 'honeycomb', |
| 38 | 'jellybean', |
| 39 | 'api21', |
| 40 | 'java' |
| 41 | ] |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 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 | |
Kirill Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 49 | 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 | |
| 60 | android.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 Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 91 | artifacts.add('archives', javadocJarTask); |
| 92 | artifacts.add('archives', sourcesJarTask); |
| 93 | } |
| 94 | |
| 95 | uploadArchives { |
| 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 | } |