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 | |
| 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 | |
| 65 | android.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 Grouchnikov | ff22d81 | 2016-05-11 15:24:25 -0700 | [diff] [blame] | 96 | artifacts.add('archives', javadocJarTask); |
| 97 | artifacts.add('archives', sourcesJarTask); |
| 98 | } |
| 99 | |
| 100 | uploadArchives { |
| 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 | } |