Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 1 | apply plugin: 'com.android.library' |
Yusuf Ozuysal | 08889ac | 2015-06-18 11:28:34 -0700 | [diff] [blame] | 2 | |
| 3 | archivesBaseName = 'customtabs' |
| 4 | |
Benoit Lize | 97ee4f3 | 2015-07-31 14:28:59 +0200 | [diff] [blame] | 5 | dependencies { |
Kirill Grouchnikov | 55fc3f2 | 2016-05-12 12:17:09 -0700 | [diff] [blame] | 6 | compile project(':support-compat') |
Benoit Lize | 97ee4f3 | 2015-07-31 14:28:59 +0200 | [diff] [blame] | 7 | compile project(':support-annotations') |
Kirill Grouchnikov | f8b9ac8 | 2016-02-11 18:44:27 -0800 | [diff] [blame] | 8 | |
| 9 | androidTestCompile ('com.android.support.test:runner:0.4.1') { |
| 10 | exclude module: 'support-annotations' |
| 11 | } |
| 12 | androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.1') { |
| 13 | exclude module: 'support-annotations' |
| 14 | } |
| 15 | testCompile 'junit:junit:4.12' |
Benoit Lize | 97ee4f3 | 2015-07-31 14:28:59 +0200 | [diff] [blame] | 16 | } |
| 17 | |
Yusuf Ozuysal | 08889ac | 2015-06-18 11:28:34 -0700 | [diff] [blame] | 18 | android { |
Yigit Boyar | 02a9e8c | 2016-01-26 20:41:00 -0800 | [diff] [blame] | 19 | compileSdkVersion project.ext.currentSdk |
Yusuf Ozuysal | 08889ac | 2015-06-18 11:28:34 -0700 | [diff] [blame] | 20 | |
Kirill Grouchnikov | f8b9ac8 | 2016-02-11 18:44:27 -0800 | [diff] [blame] | 21 | defaultConfig { |
| 22 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
| 23 | } |
| 24 | |
Yusuf Ozuysal | 08889ac | 2015-06-18 11:28:34 -0700 | [diff] [blame] | 25 | sourceSets { |
| 26 | main.manifest.srcFile 'AndroidManifest.xml' |
| 27 | main.java.srcDirs = ['src'] |
| 28 | main.aidl.srcDirs = ['src'] |
| 29 | main.res.srcDir 'res' |
| 30 | main.assets.srcDir 'assets' |
| 31 | main.resources.srcDir 'java' |
Benoit Lize | 97ee4f3 | 2015-07-31 14:28:59 +0200 | [diff] [blame] | 32 | |
| 33 | androidTest.setRoot('tests') |
| 34 | androidTest.java.srcDir('tests/src/') |
Yusuf Ozuysal | 08889ac | 2015-06-18 11:28:34 -0700 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | compileOptions { |
| 38 | sourceCompatibility JavaVersion.VERSION_1_7 |
| 39 | targetCompatibility JavaVersion.VERSION_1_7 |
| 40 | } |
| 41 | } |
Alan Viverette | 523ece8 | 2016-06-09 14:13:34 -0400 | [diff] [blame] | 42 | |
| 43 | android.libraryVariants.all { variant -> |
| 44 | def name = variant.buildType.name |
| 45 | |
| 46 | if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) { |
| 47 | return; // Skip debug builds. |
| 48 | } |
| 49 | def suffix = name.capitalize() |
| 50 | |
| 51 | def jarTask = project.tasks.create(name: "jar${suffix}", type: Jar){ |
| 52 | dependsOn variant.javaCompile |
| 53 | from variant.javaCompile.destinationDir |
| 54 | from 'LICENSE.txt' |
| 55 | } |
| 56 | def javadocTask = project.tasks.create(name: "javadoc${suffix}", type: Javadoc) { |
| 57 | source android.sourceSets.main.java |
| 58 | classpath = files(variant.javaCompile.classpath.files) + files( |
| 59 | "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar") |
| 60 | } |
| 61 | |
| 62 | def javadocJarTask = project.tasks.create(name: "javadocJar${suffix}", type: Jar) { |
| 63 | classifier = 'javadoc' |
| 64 | from 'build/docs/javadoc' |
| 65 | } |
| 66 | |
| 67 | def sourcesJarTask = project.tasks.create(name: "sourceJar${suffix}", type: Jar) { |
| 68 | classifier = 'sources' |
| 69 | from android.sourceSets.main.java.srcDirs |
| 70 | } |
| 71 | |
| 72 | artifacts.add('archives', javadocJarTask); |
| 73 | artifacts.add('archives', sourcesJarTask); |
| 74 | } |