| Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 1 | apply plugin: 'com.android.library' |
| Filip Gruszczynski | f9cabe2 | 2015-04-29 13:16:32 -0700 | [diff] [blame] | 2 | |
| 3 | archivesBaseName = 'percent' |
| 4 | |
| 5 | dependencies { |
| Kirill Grouchnikov | f4893cf | 2016-05-10 11:02:58 -0700 | [diff] [blame] | 6 | compile project(':support-compat') |
| Kirill Grouchnikov | 059c122 | 2015-12-03 13:09:16 -0500 | [diff] [blame] | 7 | |
| Kirill Grouchnikov | bcbbc06 | 2016-01-15 17:06:54 -0500 | [diff] [blame] | 8 | androidTestCompile ('com.android.support.test:runner:0.4.1') { |
| 9 | exclude module: 'support-annotations' |
| 10 | } |
| 11 | androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') { |
| 12 | exclude module: 'support-annotations' |
| 13 | } |
| Kirill Grouchnikov | 059c122 | 2015-12-03 13:09:16 -0500 | [diff] [blame] | 14 | testCompile 'junit:junit:4.12' |
| Filip Gruszczynski | f9cabe2 | 2015-04-29 13:16:32 -0700 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | android { |
| Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 18 | compileSdkVersion project.ext.currentSdk |
| Filip Gruszczynski | f9cabe2 | 2015-04-29 13:16:32 -0700 | [diff] [blame] | 19 | |
| Kirill Grouchnikov | 059c122 | 2015-12-03 13:09:16 -0500 | [diff] [blame] | 20 | defaultConfig { |
| Kirill Grouchnikov | df15399 | 2016-05-04 16:55:20 -0400 | [diff] [blame] | 21 | minSdkVersion 9 |
| Kirill Grouchnikov | 059c122 | 2015-12-03 13:09:16 -0500 | [diff] [blame] | 22 | |
| 23 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 24 | } |
| 25 | |
| Filip Gruszczynski | f9cabe2 | 2015-04-29 13:16:32 -0700 | [diff] [blame] | 26 | sourceSets { |
| 27 | main.manifest.srcFile 'AndroidManifest.xml' |
| 28 | main.java.srcDirs = ['src'] |
| 29 | main.res.srcDir 'res' |
| 30 | main.assets.srcDir 'assets' |
| 31 | main.resources.srcDir 'src' |
| 32 | |
| 33 | // this moves src/instrumentTest to tests so all folders follow: |
| 34 | // tests/java, tests/res, tests/assets, ... |
| 35 | // This is a *reset* so it replaces the default paths |
| 36 | androidTest.setRoot('tests') |
| Kirill Grouchnikov | 059c122 | 2015-12-03 13:09:16 -0500 | [diff] [blame] | 37 | androidTest.java.srcDir 'tests/java' |
| 38 | androidTest.res.srcDir 'tests/res' |
| 39 | androidTest.manifest.srcFile 'tests/AndroidManifest.xml' |
| Filip Gruszczynski | f9cabe2 | 2015-04-29 13:16:32 -0700 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | compileOptions { |
| 43 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 44 | targetCompatibility JavaVersion.VERSION_1_7 |
| 45 | } |
| 46 | } |
| Chris Banes | bb7b05d | 2015-10-13 11:32:31 +0100 | [diff] [blame] | 47 | |
| 48 | android.libraryVariants.all { variant -> |
| 49 | def name = variant.buildType.name |
| 50 | |
| 51 | if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { |
| 52 | return; // Skip debug builds. |
| 53 | } |
| 54 | def suffix = name.capitalize() |
| 55 | |
| 56 | def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ |
| 57 | dependsOn variant.javaCompile |
| 58 | from variant.javaCompile.destinationDir |
| 59 | from 'LICENSE.txt' |
| 60 | } |
| 61 | def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { |
| 62 | source android.sourceSets.main.java |
| 63 | classpath = files(variant.javaCompile.classpath.files) + files( |
| 64 | "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") |
| 65 | } |
| 66 | |
| 67 | def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { |
| 68 | classifier = 'javadoc' |
| 69 | from 'build/docs/javadoc' |
| 70 | } |
| 71 | |
| 72 | def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { |
| 73 | classifier = 'sources' |
| 74 | from android.sourceSets.main.java.srcDirs |
| 75 | } |
| 76 | |
| 77 | artifacts.add('archives', javadocJarTask); |
| 78 | artifacts.add('archives', sourcesJarTask); |
| 79 | } |
| 80 | |
| 81 | uploadArchives { |
| 82 | repositories { |
| 83 | mavenDeployer { |
| 84 | repository(url: uri(rootProject.ext.supportRepoOut)) { |
| 85 | } |
| 86 | |
| 87 | pom.project { |
| 88 | name 'Android Percent Support Library' |
| 89 | 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 7 or later." |
| 90 | url 'http://developer.android.com/tools/extras/support-library.html' |
| 91 | inceptionYear '2011' |
| 92 | |
| 93 | licenses { |
| 94 | license { |
| 95 | name 'The Apache Software License, Version 2.0' |
| 96 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 97 | distribution 'repo' |
| 98 | } |
| 99 | } |
| 100 | |
| 101 | scm { |
| 102 | url "http://source.android.com" |
| 103 | connection "scm:git:https://android.googlesource.com/platform/frameworks/support" |
| 104 | } |
| 105 | developers { |
| 106 | developer { |
| 107 | name 'The Android Open Source Project' |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | } |