Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [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 | |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 17 | apply plugin: 'com.android.library' |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 18 | archivesBaseName = 'preference-v7' |
| 19 | |
| 20 | dependencies { |
| 21 | compile project(':support-v4') |
| 22 | compile project(':support-appcompat-v7') |
| 23 | compile project(':support-recyclerview-v7') |
Tony Mantler | 8435219 | 2016-07-20 11:39:11 -0700 | [diff] [blame] | 24 | |
| 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 Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | android { |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 35 | compileSdkVersion project.ext.currentSdk |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 36 | |
Tony Mantler | 8435219 | 2016-07-20 11:39:11 -0700 | [diff] [blame] | 37 | defaultConfig { |
| 38 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
Alan Viverette | 9439d70 | 2016-10-25 14:45:10 +0100 | [diff] [blame] | 39 | minSdkVersion 9 |
Tony Mantler | 8435219 | 2016-07-20 11:39:11 -0700 | [diff] [blame] | 40 | } |
| 41 | |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 42 | sourceSets { |
| 43 | main.manifest.srcFile 'AndroidManifest.xml' |
| 44 | main.java.srcDir 'src' |
Jason Monk | 3fadd62 | 2015-10-28 14:33:19 -0400 | [diff] [blame] | 45 | main.java.srcDir 'constants' |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 46 | 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 Mantler | 8435219 | 2016-07-20 11:39:11 -0700 | [diff] [blame] | 55 | androidTest.res.srcDir 'tests/res' |
| 56 | androidTest.manifest.srcFile 'tests/AndroidManifest.xml' |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 57 | } |
| 58 | |
| 59 | compileOptions { |
| 60 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 61 | targetCompatibility JavaVersion.VERSION_1_7 |
| 62 | } |
| 63 | |
| 64 | lintOptions { |
Alan Viverette | af6b251 | 2016-11-16 17:33:10 -0500 | [diff] [blame] | 65 | // Remove this once all NewApi breakages have been fixed. |
| 66 | disable "NewApi" |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 67 | } |
Tony Mantler | 06f9ee5 | 2015-08-21 10:55:03 -0700 | [diff] [blame] | 68 | |
| 69 | buildTypes.all { |
| 70 | consumerProguardFiles 'proguard-rules.pro' |
| 71 | } |
Tony Mantler | 6904f67 | 2015-02-19 08:58:37 -0800 | [diff] [blame] | 72 | } |
Tony Mantler | a2dbc75 | 2015-10-07 15:34:36 -0700 | [diff] [blame] | 73 | |
Alan Viverette | 523ece8 | 2016-06-09 14:13:34 -0400 | [diff] [blame] | 74 | android.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 Viverette | 523ece8 | 2016-06-09 14:13:34 -0400 | [diff] [blame] | 82 | def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { |
| 83 | classifier = 'sources' |
| 84 | from android.sourceSets.main.java.srcDirs |
| 85 | } |
| 86 | |
Alan Viverette | 523ece8 | 2016-06-09 14:13:34 -0400 | [diff] [blame] | 87 | artifacts.add('archives', sourcesJarTask); |
| 88 | } |
| 89 | |
Tony Mantler | a2dbc75 | 2015-10-07 15:34:36 -0700 | [diff] [blame] | 90 | uploadArchives { |
| 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 | } |