Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 1 | apply plugin: 'com.android.library' |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 2 | |
| 3 | archivesBaseName = 'support-v13' |
| 4 | |
Justin Klaassen | 68e7adb | 2016-01-21 12:50:47 -0800 | [diff] [blame] | 5 | sourceCompatibility = JavaVersion.VERSION_1_7 |
| 6 | targetCompatibility = JavaVersion.VERSION_1_7 |
| 7 | |
Yigit Boyar | 3986e04 | 2016-02-08 18:31:38 -0800 | [diff] [blame] | 8 | createApiSourceSets(project, gradle.ext.studioCompat.modules.v13.apiTargets) |
| 9 | setApiModuleDependencies(project, dependencies, gradle.ext.studioCompat.modules.v13.dependencies) |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 10 | android { |
| 11 | compileSdkVersion 13 |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 12 | |
| 13 | defaultConfig { |
| 14 | minSdkVersion 13 |
| 15 | // TODO: get target from branch |
| 16 | //targetSdkVersion 19 |
| 17 | } |
| 18 | |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 19 | sourceSets { |
| 20 | main.manifest.srcFile 'AndroidManifest.xml' |
| 21 | main.java.srcDirs = ['java'] |
| 22 | main.aidl.srcDirs = ['java'] |
| 23 | |
| 24 | androidTest.setRoot('tests') |
| 25 | androidTest.java.srcDir 'tests/java' |
| 26 | } |
| 27 | |
Justin Klaassen | 68e7adb | 2016-01-21 12:50:47 -0800 | [diff] [blame] | 28 | compileOptions { |
| 29 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 30 | targetCompatibility JavaVersion.VERSION_1_7 |
| 31 | } |
| 32 | |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 33 | lintOptions { |
| 34 | // TODO: fix errors and reenable. |
| 35 | abortOnError false |
| 36 | } |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 37 | |
| 38 | compileOptions { |
| 39 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 40 | targetCompatibility JavaVersion.VERSION_1_7 |
| 41 | } |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 42 | } |
| 43 | |
| 44 | android.libraryVariants.all { variant -> |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 45 | def name = variant.buildType.name |
| 46 | |
Chris Banes | 4efd038 | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 47 | if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 48 | return; // Skip debug builds. |
| 49 | } |
| 50 | def suffix = name.capitalize() |
| 51 | |
| 52 | def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ |
| 53 | dependsOn variant.javaCompile |
| 54 | from variant.javaCompile.destinationDir |
| 55 | from 'LICENSE.txt' |
| 56 | } |
| 57 | def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { |
Chris Banes | 4efd038 | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 58 | source android.sourceSets.main.java |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 59 | classpath = files(variant.javaCompile.classpath.files) + files( |
Chris Banes | 4efd038 | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 60 | "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { |
| 64 | classifier = 'javadoc' |
| 65 | from 'build/docs/javadoc' |
| 66 | } |
| 67 | |
| 68 | def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { |
| 69 | classifier = 'sources' |
Chris Banes | 4efd038 | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 70 | from android.sourceSets.main.java.srcDirs |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | project.ext.allSS.each { ss -> |
Chris Banes | 4efd038 | 2015-03-05 20:04:05 +0000 | [diff] [blame] | 74 | javadocTask.source ss.java |
| 75 | sourcesJarTask.from ss.java.srcDirs |
Yigit Boyar | 5932b6f | 2014-04-30 13:43:59 -0700 | [diff] [blame] | 76 | } |
| 77 | |
| 78 | artifacts.add('archives', javadocJarTask); |
| 79 | artifacts.add('archives', sourcesJarTask); |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | uploadArchives { |
| 83 | repositories { |
| 84 | mavenDeployer { |
| 85 | |
Xavier Ducrohet | 855a922 | 2014-01-02 19:00:43 -0800 | [diff] [blame] | 86 | repository(url: uri(rootProject.ext.supportRepoOut)) { |
Xavier Ducrohet | 86fb8ef | 2013-02-22 15:04:37 -0800 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | pom.project { |
| 90 | name 'Android Support Library v13' |
| 91 | 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 13 or later." |
| 92 | url 'http://developer.android.com/tools/extras/support-library.html' |
| 93 | inceptionYear '2011' |
| 94 | |
| 95 | licenses { |
| 96 | license { |
| 97 | name 'The Apache Software License, Version 2.0' |
| 98 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 99 | distribution 'repo' |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | scm { |
| 104 | url "http://source.android.com" |
| 105 | connection "scm:git:https://android.googlesource.com/platform/frameworks/support" |
| 106 | } |
| 107 | developers { |
| 108 | developer { |
| 109 | name 'The Android Open Source Project' |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | } |