blob: 75d68d147ff6852dca7d6cd8dfaab57d1b432905 [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Chris Banes8d5b8a62015-08-19 14:45:09 +01002
3archivesBaseName = 'recommendation'
4
5dependencies {
6 compile project(':support-v4')
7}
8
9android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080010 compileSdkVersion project.ext.currentSdk
Chris Banes8d5b8a62015-08-19 14:45:09 +010011
Jose Limabd6fc082015-08-20 16:30:01 -070012 defaultConfig {
13 minSdkVersion 21
14 }
15
Chris Banes8d5b8a62015-08-19 14:45:09 +010016 sourceSets {
17 main.manifest.srcFile 'AndroidManifest.xml'
18 main.java.srcDirs = ['src']
19 main.res.srcDir 'res'
20 main.assets.srcDir 'assets'
21 main.resources.srcDir 'src'
22
23 // this moves src/instrumentTest to tests so all folders follow:
24 // tests/java, tests/res, tests/assets, ...
25 // This is a *reset* so it replaces the default paths
26 androidTest.setRoot('tests')
27 androidTest.java.srcDir 'tests/src'
28 }
29
30 compileOptions {
31 sourceCompatibility JavaVersion.VERSION_1_7
32 targetCompatibility JavaVersion.VERSION_1_7
33 }
34}
Alan Viverette523ece82016-06-09 14:13:34 -040035
36android.libraryVariants.all { variant ->
37 def name = variant.buildType.name
38
39 if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
40 return; // Skip debug builds.
41 }
42 def suffix = name.capitalize()
43
44 def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){
45 dependsOn variant.javaCompile
46 from variant.javaCompile.destinationDir
47 from 'LICENSE.txt'
48 }
49 def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) {
50 source android.sourceSets.main.java
51 classpath = files(variant.javaCompile.classpath.files) + files(
52 "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar")
53 }
54
55 def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) {
56 classifier = 'javadoc'
57 from 'build/docs/javadoc'
58 }
59
60 def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) {
61 classifier = 'sources'
62 from android.sourceSets.main.java.srcDirs
63 }
64
65 artifacts.add('archives', javadocJarTask);
66 artifacts.add('archives', sourcesJarTask);
67}