blob: 83cbd276ef6fbde23a90beee24567ec0bfe733c9 [file] [log] [blame]
Alan Viverette05f668c2017-02-03 16:54:44 -05001/*
2 * Copyright (C) 2017 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
17apply plugin: 'com.android.library'
Justin Moreyda744112014-01-08 15:06:43 -060018
Yohann Roussel67bac2e2018-01-24 18:46:51 +010019def generatedResourceDir = project.file('generatedResource')
20def versionFile = new File(generatedResourceDir, 'androidsupportmultidexversion.txt')
21
22task makeVersionFile(type:Exec) {
23
24 doFirst {
25 versionFile.getParentFile().mkdirs()
26 }
27
28 outputs.files versionFile
29
30 commandLine 'sh', '-c', 'git log --format="%H" -n 1 || (echo git hash not available; exit 0)'
31 standardOutput = new ByteArrayOutputStream()
32
33 doLast {
34 versionFile.text = "git.version=" + standardOutput.toString()
35 }
36}
37
Justin Moreyda744112014-01-08 15:06:43 -060038android {
Xavier Ducrohetb98bb462014-10-27 21:12:20 -070039 compileSdkVersion 4
40
Alan Viverette05f668c2017-02-03 16:54:44 -050041 defaultConfig {
42 minSdkVersion 4
Alan Viverette05f668c2017-02-03 16:54:44 -050043 }
44
Yohann Roussel78dfa212018-01-24 18:17:27 +010045 compileOptions {
46 sourceCompatibility JavaVersion.VERSION_1_7
47 targetCompatibility JavaVersion.VERSION_1_7
48 }
49
Justin Moreyda744112014-01-08 15:06:43 -060050 sourceSets {
51 main {
52 java.srcDirs = ['src']
Yohann Roussel67bac2e2018-01-24 18:46:51 +010053 resources.srcDirs = ['res', makeVersionFile.outputs]
Justin Moreyda744112014-01-08 15:06:43 -060054 res.srcDirs = ['src']
55 manifest.srcFile 'AndroidManifest.xml'
56 }
57 }
Justin Morey87fb5742014-01-30 19:52:52 -060058
59 lintOptions {
60 // TODO: fix errors and reenable.
61 abortOnError false
62 }
Justin Moreyda744112014-01-08 15:06:43 -060063}
Xavier Ducrohetb98bb462014-10-27 21:12:20 -070064
Yohann Roussel67bac2e2018-01-24 18:46:51 +010065android.libraryVariants.all {
66 v -> v.getJavaCompiler().dependsOn(makeVersionFile)
67}
68
Xavier Ducrohetb98bb462014-10-27 21:12:20 -070069uploadArchives {
70 repositories {
71 mavenDeployer {
72 repository(url: uri(rootProject.ext.supportRepoOut)) {
73 }
74
75 pom.project {
76 name 'Android Multi-Dex Library'
77 description "Library for legacy multi-dex support"
78 url ''
79 inceptionYear '2013'
80
81 licenses {
82 license {
83 name 'The Apache Software License, Version 2.0'
84 url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
85 distribution 'repo'
86 }
87 }
88
89 scm {
90 url "http://source.android.com"
91 connection "scm:git:https://android.googlesource.com/platform/frameworks/multidex"
92 }
93 developers {
94 developer {
95 name 'The Android Open Source Project'
96 }
97 }
98 }
99 }
100 }
Alan Viverette05f668c2017-02-03 16:54:44 -0500101}