blob: 7cae6c3e649a58327494a36ce63bb874c48ea6d3 [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -08002
3archivesBaseName = 'gridlayout-v7'
4
Xavier Ducrohete8b71222013-11-20 16:30:26 -08005dependencies {
Xavier Ducrohet855a9222014-01-02 19:00:43 -08006 compile project(':support-v4')
Kirill Grouchnikov1d3991c2016-02-12 10:58:38 -08007
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 }
14 testCompile 'junit:junit:4.12'
Xavier Ducrohete8b71222013-11-20 16:30:26 -080015}
16
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080017android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080018 compileSdkVersion project.ext.currentSdk
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080019
Kirill Grouchnikov1d3991c2016-02-12 10:58:38 -080020 defaultConfig {
21 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
22 }
23
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080024 sourceSets {
25 main.manifest.srcFile 'AndroidManifest.xml'
26 main.java.srcDir 'src'
27 main.res.srcDir 'res'
28 main.assets.srcDir 'assets'
29 main.resources.srcDir 'src'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080030
31 // this moves src/instrumentTest to tests so all folders follow:
32 // tests/java, tests/res, tests/assets, ...
33 // This is a *reset* so it replaces the default paths
Xavier Ducrohet020e4322014-03-18 16:41:30 -070034 androidTest.setRoot('tests')
35 androidTest.java.srcDir 'tests/src'
Yigit Boyaraba8d472015-03-03 18:12:33 -080036 androidTest.res.srcDir 'tests/res'
37 androidTest.manifest.srcFile 'tests/AndroidManifest.xml'
Xavier Ducrohet86fb8ef2013-02-22 15:04:37 -080038 }
Justin Morey7e2ae652014-01-30 19:54:36 -060039
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080040 compileOptions {
41 sourceCompatibility JavaVersion.VERSION_1_7
42 targetCompatibility JavaVersion.VERSION_1_7
43 }
44
Justin Morey7e2ae652014-01-30 19:54:36 -060045 lintOptions {
46 // TODO: fix errors and reenable.
47 abortOnError false
48 }
Raphael Moll5057daa2013-10-29 17:01:14 -070049}
Xavier Ducrohet11b83982015-03-31 15:12:42 -070050
51
52android.libraryVariants.all { variant ->
53 def name = variant.buildType.name
54
55 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
56 return; // Skip debug builds.
57 }
58 def suffix = name.capitalize()
59
60 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
61 dependsOn variant.javaCompile
62 from variant.javaCompile.destinationDir
63 from 'LICENSE.txt'
64 }
65 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
66 source android.sourceSets.main.java
67 classpath = files(variant.javaCompile.classpath.files) + files(
68 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
69 }
70
71 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
72 classifier = 'javadoc'
73 from 'build/docs/javadoc'
74 }
75
76 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
77 classifier = 'sources'
78 from android.sourceSets.main.java.srcDirs
79 }
80
81 artifacts.add('archives', javadocJarTask);
82 artifacts.add('archives', sourcesJarTask);
83}
84
85uploadArchives {
86 repositories {
87 mavenDeployer {
88 repository(url: uri(rootProject.ext.supportRepoOut)) {
89 }
90
91 pom.project {
92 name 'Android Support Library v4'
93 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 4 or later."
94 url 'http://developer.android.com/tools/extras/support-library.html'
95 inceptionYear '2011'
96
97 licenses {
98 license {
99 name 'The Apache Software License, Version 2.0'
100 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
101 distribution 'repo'
102 }
103 }
104
105 scm {
106 url "http://source.android.com"
107 connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
108 }
109 developers {
110 developer {
111 name 'The Android Open Source Project'
112 }
113 }
114 }
115 }
116 }
117}