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