Alan Viverette | 05f668c | 2017-02-03 16:54:44 -0500 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | apply plugin: 'com.android.library' |
Justin Morey | da74411 | 2014-01-08 15:06:43 -0600 | [diff] [blame] | 18 | |
Yohann Roussel | 67bac2e | 2018-01-24 18:46:51 +0100 | [diff] [blame] | 19 | def generatedResourceDir = project.file('generatedResource') |
| 20 | def versionFile = new File(generatedResourceDir, 'androidsupportmultidexversion.txt') |
| 21 | |
| 22 | task 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 Morey | da74411 | 2014-01-08 15:06:43 -0600 | [diff] [blame] | 38 | android { |
Xavier Ducrohet | b98bb46 | 2014-10-27 21:12:20 -0700 | [diff] [blame] | 39 | compileSdkVersion 4 |
| 40 | |
Alan Viverette | 05f668c | 2017-02-03 16:54:44 -0500 | [diff] [blame] | 41 | defaultConfig { |
| 42 | minSdkVersion 4 |
Alan Viverette | 05f668c | 2017-02-03 16:54:44 -0500 | [diff] [blame] | 43 | } |
| 44 | |
Yohann Roussel | 78dfa21 | 2018-01-24 18:17:27 +0100 | [diff] [blame] | 45 | compileOptions { |
| 46 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 47 | targetCompatibility JavaVersion.VERSION_1_7 |
| 48 | } |
| 49 | |
Justin Morey | da74411 | 2014-01-08 15:06:43 -0600 | [diff] [blame] | 50 | sourceSets { |
| 51 | main { |
| 52 | java.srcDirs = ['src'] |
Yohann Roussel | 67bac2e | 2018-01-24 18:46:51 +0100 | [diff] [blame] | 53 | resources.srcDirs = ['res', makeVersionFile.outputs] |
Justin Morey | da74411 | 2014-01-08 15:06:43 -0600 | [diff] [blame] | 54 | res.srcDirs = ['src'] |
| 55 | manifest.srcFile 'AndroidManifest.xml' |
| 56 | } |
| 57 | } |
Justin Morey | 87fb574 | 2014-01-30 19:52:52 -0600 | [diff] [blame] | 58 | |
| 59 | lintOptions { |
| 60 | // TODO: fix errors and reenable. |
| 61 | abortOnError false |
| 62 | } |
Justin Morey | da74411 | 2014-01-08 15:06:43 -0600 | [diff] [blame] | 63 | } |
Xavier Ducrohet | b98bb46 | 2014-10-27 21:12:20 -0700 | [diff] [blame] | 64 | |
Yohann Roussel | 67bac2e | 2018-01-24 18:46:51 +0100 | [diff] [blame] | 65 | android.libraryVariants.all { |
| 66 | v -> v.getJavaCompiler().dependsOn(makeVersionFile) |
| 67 | } |
| 68 | |
Xavier Ducrohet | b98bb46 | 2014-10-27 21:12:20 -0700 | [diff] [blame] | 69 | uploadArchives { |
| 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 Viverette | 05f668c | 2017-02-03 16:54:44 -0500 | [diff] [blame] | 101 | } |