Tony Mantler | 2a90a3f | 2015-03-19 13:19:46 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2015 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License |
| 15 | */ |
| 16 | |
| 17 | |
| 18 | |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 19 | apply plugin: 'com.android.library' |
Tony Mantler | 2a90a3f | 2015-03-19 13:19:46 -0700 | [diff] [blame] | 20 | |
Tony Mantler | d2e2c83 | 2015-03-23 09:58:10 -0700 | [diff] [blame] | 21 | archivesBaseName = 'preference-leanback-v17' |
Tony Mantler | 2a90a3f | 2015-03-19 13:19:46 -0700 | [diff] [blame] | 22 | |
| 23 | dependencies { |
| 24 | compile project(':support-v4') |
| 25 | compile project(':support-appcompat-v7') |
| 26 | compile project(':support-recyclerview-v7') |
| 27 | compile project(':support-preference-v7') |
| 28 | compile project(':support-preference-v14') |
| 29 | compile project(':support-leanback-v17') |
| 30 | } |
| 31 | |
| 32 | android { |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 33 | compileSdkVersion project.ext.currentSdk |
Tony Mantler | 2a90a3f | 2015-03-19 13:19:46 -0700 | [diff] [blame] | 34 | |
| 35 | sourceSets { |
| 36 | main.manifest.srcFile 'AndroidManifest.xml' |
Tony Mantler | 2dce94c | 2015-07-10 10:52:47 -0700 | [diff] [blame] | 37 | main.java.srcDirs = ['src', 'api21'] |
Tony Mantler | 2a90a3f | 2015-03-19 13:19:46 -0700 | [diff] [blame] | 38 | main.res.srcDir 'res' |
| 39 | main.assets.srcDir 'assets' |
| 40 | main.resources.srcDir 'src' |
| 41 | |
| 42 | // this moves src/instrumentTest to tests so all folders follow: |
| 43 | // tests/java, tests/res, tests/assets, ... |
| 44 | // This is a *reset* so it replaces the default paths |
| 45 | androidTest.setRoot('tests') |
| 46 | androidTest.java.srcDir 'tests/src' |
| 47 | } |
| 48 | |
| 49 | compileOptions { |
| 50 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 51 | targetCompatibility JavaVersion.VERSION_1_7 |
| 52 | } |
| 53 | |
| 54 | lintOptions { |
| 55 | // TODO: fix errors and reenable. |
| 56 | abortOnError false |
| 57 | } |
| 58 | } |
Tony Mantler | a2dbc75 | 2015-10-07 15:34:36 -0700 | [diff] [blame] | 59 | |
Alan Viverette | 523ece8 | 2016-06-09 14:13:34 -0400 | [diff] [blame^] | 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 | } |
| 88 | |
| 89 | artifacts.add('archives', javadocJarTask); |
| 90 | artifacts.add('archives', sourcesJarTask); |
| 91 | } |
| 92 | |
Tony Mantler | a2dbc75 | 2015-10-07 15:34:36 -0700 | [diff] [blame] | 93 | uploadArchives { |
| 94 | repositories { |
| 95 | mavenDeployer { |
| 96 | repository(url: uri(rootProject.ext.supportRepoOut)) { |
| 97 | } |
| 98 | |
| 99 | pom.project { |
| 100 | name 'Android Support Leanback Preference v17' |
| 101 | description "Android Support Leanback Preference v17" |
| 102 | url 'http://developer.android.com/tools/extras/support-library.html' |
| 103 | inceptionYear '2015' |
| 104 | |
| 105 | licenses { |
| 106 | license { |
| 107 | name 'The Apache Software License, Version 2.0' |
| 108 | url 'http://www.apache.org/licenses/LICENSE-2.0.txt' |
| 109 | distribution 'repo' |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | scm { |
| 114 | url "http://source.android.com" |
| 115 | connection "scm:git:https://android.googlesource.com/platform/frameworks/support" |
| 116 | } |
| 117 | developers { |
| 118 | developer { |
| 119 | name 'The Android Open Source Project' |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | } |