blob: 150467f00d61f9b28d85bf24d5326281840d3fbd [file] [log] [blame]
Yigit Boyar02a9e8c2016-01-26 20:41:00 -08001apply plugin: 'com.android.library'
Yusuf Ozuysal08889ac2015-06-18 11:28:34 -07002
3archivesBaseName = 'customtabs'
4
Benoit Lize97ee4f32015-07-31 14:28:59 +02005dependencies {
Kirill Grouchnikov55fc3f22016-05-12 12:17:09 -07006 compile project(':support-compat')
Benoit Lize97ee4f32015-07-31 14:28:59 +02007 compile project(':support-annotations')
Kirill Grouchnikovf8b9ac82016-02-11 18:44:27 -08008
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 Lize97ee4f32015-07-31 14:28:59 +020016}
17
Yusuf Ozuysal08889ac2015-06-18 11:28:34 -070018android {
Yigit Boyar02a9e8c2016-01-26 20:41:00 -080019 compileSdkVersion project.ext.currentSdk
Yusuf Ozuysal08889ac2015-06-18 11:28:34 -070020
Kirill Grouchnikovf8b9ac82016-02-11 18:44:27 -080021 defaultConfig {
22 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
23 }
24
Yusuf Ozuysal08889ac2015-06-18 11:28:34 -070025 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 Lize97ee4f32015-07-31 14:28:59 +020032
33 androidTest.setRoot('tests')
34 androidTest.java.srcDir('tests/src/')
Yusuf Ozuysal08889ac2015-06-18 11:28:34 -070035 }
36
37 compileOptions {
38 sourceCompatibility JavaVersion.VERSION_1_7
39 targetCompatibility JavaVersion.VERSION_1_7
40 }
41}
Alan Viverette523ece82016-06-09 14:13:34 -040042
43android.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}