-
Notifications
You must be signed in to change notification settings - Fork 63
/
build.gradle
executable file
·132 lines (110 loc) · 4.25 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
apply plugin: 'com.android.library'
apply plugin: 'jacoco'
apply plugin: 'maven-publish'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'com.vanniktech.maven.publish'
jacoco {
toolVersion = "0.8.5"
}
project.ext {
archLifecycleVersion = "2.2.0"
}
android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
useLibrary 'android.test.base'
defaultConfig {
// With API 24: Remove `androidx.appcompat:appcompat` as it's needed for Consumer<T>.
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "$project.version"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
debug {
buildConfigField "String", "TRACKER_LABEL", "\"andr-$project.version\""
buildConfigField "String", "TRACKER_VERSION", "\"$project.version\""
testCoverageEnabled = true
}
release {
buildConfigField "String", "TRACKER_LABEL", "\"andr-$project.version\""
buildConfigField "String", "TRACKER_VERSION", "\"$project.version\""
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'LICENSE.txt'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/DEPENDENCIES'
}
lintOptions {
disable 'InvalidPackage'
abortOnError false
}
sourceSets {
androidTest.manifest.srcFile "src/androidTest/AndroidManifest.xml"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
// This enables long timeouts required on slow environments
adbOptions {
timeOutInMs 10 * 60 * 1000 // Set the timeout to 10 minutes
installOptions "-d","-t"
}
}
dependencies {
implementation 'androidx.annotation:annotation:1.2.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
compileOnly "androidx.lifecycle:lifecycle-extensions:$project.archLifecycleVersion"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.squareup.okhttp3:okhttp:4.9.1'
// test
testImplementation "androidx.lifecycle:lifecycle-extensions:$project.archLifecycleVersion"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation 'com.google.android.gms:play-services-analytics:17.0.0'
androidTestImplementation 'com.squareup.okhttp3:mockwebserver:4.0.0'
}
android.libraryVariants.all { variant ->
task("generate${variant.name.capitalize()}Javadoc", type: Javadoc) {
title = "Documentation for snowplow-android-core $version API"
description "Generates Javadoc for $variant.name."
source = variant.getJavaCompileProvider().get().source
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
doFirst { classpath = files(variant.javaCompiler.classpath.files) + files(ext.androidJar) }
options.links("http://docs.oracle.com/javase/7/docs/api/");
exclude '**/R.java'
}
}
coveralls {
jacocoReportPath "$buildDir/reports/coverage/debug/report.xml"
}
signing {
useInMemoryPgpKeys(System.getenv('SONA_PGP_SECRET'), System.getenv('SONA_PGP_PASSPHRASE'))
}
// Deprecated: to fix as explained in https://github.com/vanniktech/gradle-maven-publish-plugin/issues/137
mavenPublish {
targets {
uploadArchives {
releaseRepositoryUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
repositoryUsername = System.getenv('SONA_USER')
repositoryPassword = System.getenv('SONA_PASS')
}
}
nexus {
repositoryUsername = System.getenv('SONA_USER') // defaults to the mavenCentralRepositoryUsername Gradle Property
repositoryPassword = System.getenv('SONA_PASS') // defaults to the mavenCentralRepositoryPassword Gradle Property
}
}
repositories {
mavenCentral()
}