-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle
104 lines (86 loc) · 2.36 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
version '2.3.1'
group 'com.kissmetrics.sdk'
}
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
allprojects {
repositories {
google()
jcenter()
}
}
android {
compileSdkVersion 26
defaultConfig {
minSdkVersion 8
targetSdkVersion 26
versionCode 5
versionName project.version
}
buildTypes {
release {
minifyEnabled false
}
debug {
debuggable true
}
}
defaultConfig {
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
testOptions {
unitTests.returnDefaultValues = true
}
packagingOptions {
exclude 'LICENSE.txt'
}
}
dependencies {
androidTestImplementation group: 'com.android.support.test', name: 'testing-support-lib', version: '0.1'
testImplementation 'junit:junit:4.12'
}
// Take from
// http://stackoverflow.com/questions/19307341/android-library-gradle-release-jar/19484146#19484146
android.libraryVariants.all { variant ->
def name = variant.buildType.name
if (name.equals(com.android.builder.core.BuilderConstants.DEBUG)) {
return; // Skip debug builds.
}
def task = project.tasks.create "jar${name.capitalize()}", Jar
task.dependsOn variant.javaCompile
task.from variant.javaCompile.destinationDir
artifacts.add('archives', task)
}
// This magic came from:
// http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation
task javadocs(type: Javadoc) {
android.libraryVariants.all { variant ->
title = "KISSmetrics Android API ${android.defaultConfig.versionName}"
source = android.sourceSets.main.java.srcDirs
classpath = files(variant.javaCompile.classpath.files, project.android.getBootClasspath())
// options {
// links "http://docs.oracle.com/javase/7/docs/api/"
// linksOffline "http://d.android.com/reference", "${android.sdkDirectory}/docs/reference"
// }
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
}
task sourcesJar(type: Jar) {
classifier 'sources'
from android.sourceSets.main.java.srcDirs
}
task javadocsJar(type: Jar, dependsOn: javadocs) {
classifier 'javadoc'
from "${project.buildDir}/docs/javadoc"
}