blob: b5fd656cf582102f33ad53359a4e6685a81f1378 [file] [log] [blame]
Tony Mantler6904f672015-02-19 08:58:37 -08001/*
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
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080017apply plugin: 'com.android.library'
Tony Mantler6904f672015-02-19 08:58:37 -080018archivesBaseName = 'preference-v7'
19
20dependencies {
21 compile project(':support-v4')
22 compile project(':support-appcompat-v7')
23 compile project(':support-recyclerview-v7')
Tony Mantler84352192016-07-20 11:39:11 -070024
25 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") {
26 exclude module: 'support-annotations'
27 }
28 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") {
29 exclude module: 'support-annotations'
30 }
31 testCompile 'junit:junit:4.12'
Tony Mantler6904f672015-02-19 08:58:37 -080032}
33
34android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080035 compileSdkVersion project.ext.currentSdk
Tony Mantler6904f672015-02-19 08:58:37 -080036
Tony Mantler84352192016-07-20 11:39:11 -070037 defaultConfig {
38 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
Alan Viverette9439d702016-10-25 14:45:10 +010039 minSdkVersion 9
Tony Mantler84352192016-07-20 11:39:11 -070040 }
41
Tony Mantler6904f672015-02-19 08:58:37 -080042 sourceSets {
43 main.manifest.srcFile 'AndroidManifest.xml'
44 main.java.srcDir 'src'
Jason Monk3fadd622015-10-28 14:33:19 -040045 main.java.srcDir 'constants'
Tony Mantler6904f672015-02-19 08:58:37 -080046 main.res.srcDir 'res'
47 main.assets.srcDir 'assets'
48 main.resources.srcDir 'src'
49
50 // this moves src/instrumentTest to tests so all folders follow:
51 // tests/java, tests/res, tests/assets, ...
52 // This is a *reset* so it replaces the default paths
53 androidTest.setRoot('tests')
54 androidTest.java.srcDir 'tests/src'
Tony Mantler84352192016-07-20 11:39:11 -070055 androidTest.res.srcDir 'tests/res'
56 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Tony Mantler6904f672015-02-19 08:58:37 -080057 }
58
59 compileOptions {
60 sourceCompatibility JavaVersion.VERSION_1_7
61 targetCompatibility JavaVersion.VERSION_1_7
62 }
63
64 lintOptions {
Alan Viveretteaf6b2512016-11-16 17:33:10 -050065 // Remove this once all NewApi breakages have been fixed.
66 disable "NewApi"
Tony Mantler6904f672015-02-19 08:58:37 -080067 }
Tony Mantler06f9ee52015-08-21 10:55:03 -070068
69 buildTypes.all {
70 consumerProguardFiles 'proguard-rules.pro'
71 }
Tony Mantler6904f672015-02-19 08:58:37 -080072}
Tony Mantlera2dbc752015-10-07 15:34:36 -070073
Alan Viverette523ece82016-06-09 14:13:34 -040074android.libraryVariants.all { variant ->
75 def name = variant.buildType.name
76
77 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
78 return; // Skip debug builds.
79 }
80 def suffix = name.capitalize()
81
Alan Viverette523ece82016-06-09 14:13:34 -040082 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
83 classifier = 'sources'
84 from android.sourceSets.main.java.srcDirs
85 }
86
Alan Viverette523ece82016-06-09 14:13:34 -040087 artifacts.add('archives', sourcesJarTask);
88}
89
Tony Mantlera2dbc752015-10-07 15:34:36 -070090uploadArchives {
91 repositories {
92 mavenDeployer {
93 repository(url: uri(rootProject.ext.supportRepoOut)) {
94 }
95
96 pom.project {
97 name 'Android Support Preference v7'
98 description "Android Support Preference v7"
99 url 'http://developer.android.com/tools/extras/support-library.html'
100 inceptionYear '2015'
101
102 licenses {
103 license {
104 name 'The Apache Software License, Version 2.0'
105 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
106 distribution 'repo'
107 }
108 }
109
110 scm {
111 url "http://source.android.com"
112 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
113 }
114 developers {
115 developer {
116 name 'The Android Open Source Project'
117 }
118 }
119 }
120 }
121 }
122}