• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1apply plugin: 'android-library'
2
3archivesBaseName = 'leanback-v17'
4
5dependencies {
6    compile project(':support-v4')
7    compile project(':support-recyclerview-v7')
8}
9
10android {
11    // WARNING: should be 17
12    compileSdkVersion 'current'
13
14    buildToolsVersion "19.0.1"
15
16    defaultConfig {
17        minSdkVersion 17
18        // TODO: get target from branch
19        //targetSdkVersion 19
20    }
21
22    sourceSets {
23        main.manifest.srcFile 'AndroidManifest.xml'
24        main.java.srcDirs = ['common', 'jbmr2', 'kitkat', 'api21', 'src']
25        main.aidl.srcDirs = ['common', 'jbmr2', 'kitkat', 'api21', 'src']
26        main.res.srcDirs = ['res']
27
28        androidTest.setRoot('tests')
29        androidTest.java.srcDir 'tests/java'
30    }
31
32    lintOptions {
33        // TODO: fix errors and reenable.
34        abortOnError false
35    }
36}
37
38android.libraryVariants.all { variant ->
39    def name = variant.buildType.name
40
41    if (name.equals(com.android.builder.BuilderConstants.DEBUG)) {
42        return; // Skip debug builds.
43    }
44    def suffix = name.capitalize()
45
46    def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
47        dependsOn variant.javaCompile
48        from variant.javaCompile.destinationDir
49        from 'LICENSE.txt'
50    }
51    def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
52        source android.sourceSets.main.allJava
53        classpath = files(variant.javaCompile.classpath.files) + files(
54                "${android.plugin.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
55    }
56
57    def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
58        classifier = 'javadoc'
59        from 'build/docs/javadoc'
60    }
61
62    def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
63        classifier = 'sources'
64        from android.sourceSets.main.allSource
65    }
66
67    artifacts.add('archives', javadocJarTask);
68    artifacts.add('archives', sourcesJarTask);
69}
70
71uploadArchives {
72    repositories {
73        mavenDeployer {
74            repository(url: uri(rootProject.ext.supportRepoOut)) {
75            }
76
77            pom.project {
78                name 'Android Support Leanback v17'
79                description "Android Support Leanback v17"
80                url 'http://developer.android.com/tools/extras/support-library.html'
81                inceptionYear '2011'
82
83                licenses {
84                    license {
85                        name 'The Apache Software License, Version 2.0'
86                        url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
87                        distribution 'repo'
88                    }
89                }
90
91                scm {
92                    url "http://source.android.com"
93                    connection "scm:git:https://android.googlesource.com/platform/frameworks/support"
94                }
95                developers {
96                    developer {
97                        name 'The Android Open Source Project'
98                    }
99                }
100            }
101        }
102    }
103}
104