1 apply plugin: 'com.android.library' 2 3 archivesBaseName = 'support-vector-drawable' 4 5 dependencies { 6 compile project(':support-compat') 7 androidTestCompile ("com.android.support.test:runner:${project.rootProject.ext.testRunnerVersion}") { 8 exclude module: 'support-annotations' 9 } 10 androidTestCompile ("com.android.support.test.espresso:espresso-core:${project.rootProject.ext.espressoVersion}") { 11 exclude module: 'support-annotations' 12 } 13 testCompile 'junit:junit:4.12' 14 } 15 16 android { 17 compileSdkVersion 23 18 19 defaultConfig { 20 minSdkVersion 9 21 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 22 // This disables the builds tools automatic vector -> PNG generation 23 generatedDensities = [] 24 } 25 26 sourceSets { 27 main.manifest.srcFile 'AndroidManifest.xml' 28 main.java.srcDir 'src' 29 30 androidTest.setRoot('tests') 31 androidTest.java.srcDir 'tests/src' 32 androidTest.res.srcDir 'tests/res' 33 androidTest.manifest.srcFile 'tests/AndroidManifest.xml' 34 } 35 36 compileOptions { 37 sourceCompatibility JavaVersion.VERSION_1_7 38 targetCompatibility JavaVersion.VERSION_1_7 39 } 40 41 lintOptions { 42 abortOnError false 43 } 44 45 aaptOptions { 46 additionalParameters "--no-version-vectors" 47 } 48 49 packagingOptions { 50 exclude 'LICENSE.txt' 51 } 52 53 testOptions { 54 unitTests.returnDefaultValues = true 55 } 56 } 57 58 android.libraryVariants.all { variant -> 59 def name = variant.buildType.name 60 61 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { 62 return; // Skip debug builds. 63 } 64 def suffix = name.capitalize() 65 66 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar) { 67 dependsOn variant.javaCompile 68 from variant.javaCompile.destinationDir 69 from 'LICENSE.txt' 70 } 71 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { 72 source android.sourceSets.main.java 73 classpath = files(variant.javaCompile.classpath.files) + files( 74 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") 75 } 76 77 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { 78 classifier = 'javadoc' 79 from 'build/docs/javadoc' 80 } 81 82 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { 83 classifier = 'sources' 84 from android.sourceSets.main.java.srcDirs 85 } 86 87 artifacts.add('archives', javadocJarTask); 88 artifacts.add('archives', sourcesJarTask); 89 } 90 91 uploadArchives { 92 repositories { 93 mavenDeployer { 94 repository(url: uri(rootProject.ext.supportRepoOut)) { 95 } 96 97 pom.project { 98 name 'Android Support VectorDrawable' 99 description "Android Support VectorDrawable" 100 url 'http://developer.android.com/tools/extras/support-library.html' 101 inceptionYear '2015' 102 103 licenses { 104 license { 105 name 'The Apache Software License, Version 2.0' 106 url 'http://www.apache.org/licenses/LICENSE-2.0.txt' 107 distribution 'repo' 108 } 109 } 110 111 scm { 112 url "http://source.android.com" 113 connection "scm:git:https://android.googlesource.com/platform/frameworks/support" 114 } 115 developers { 116 developer { 117 name 'The Android Open Source Project' 118 } 119 } 120 } 121 } 122 } 123 } 124