-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (122 loc) · 5.35 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
132
133
134
135
136
137
138
139
140
141
142
143
apply plugin: 'com.android.application'
apply plugin: 'com.adarshr.test-logger'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
apply from: '../plugins/jacoco-plugin.gradle'
android {
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolVersion
defaultConfig {
applicationId rootProject.ext.applicationId
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode rootProject.ext.versionCode
versionName rootProject.ext.versionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
defaultConfig {
kapt {
arguments {
// This is the location of the generated schemas for the Room database and
// must be added to version control but removed from APK.
arg("room.schemaLocation", "$project.projectDir/schemas".toString())
}
}
}
}
sourceSets {
String mainKotlinDir = "src/main/kotlin"
String sharedTestKotlinDir = "src/shared/kotlin"
String sharedResourceKotlinDir = "src/shared/res"
String unitTestKotlinDir = "src/test/kotlin"
String androidTestKotlinDir = "src/androidTest/kotlin"
main {
java.srcDir mainKotlinDir
}
test {
java.srcDir unitTestKotlinDir
java.srcDir sharedTestKotlinDir
resources.srcDir sharedResourceKotlinDir
}
androidTest {
java.srcDir androidTestKotlinDir
java.srcDir sharedTestKotlinDir
resources.srcDir sharedResourceKotlinDir
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
debug {
testCoverageEnabled true
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.all {
// Apply the gradle logs which the custom logger will configure
testLogging {
events "passed", "skipped", "failed", "standardOut", "standardError"
outputs.upToDateWhen { false }
showStandardStreams = true
}
}
}
}
// Makes sure that kotlin test will not be used in production code
afterEvaluate {
android.sourceSets.all { sourceSet ->
if (!sourceSet.name.startsWith("test") || !sourceSet.name.startsWith("androidTest")) {
sourceSet.kotlin.setSrcDirs([])
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Community Library
implementation "io.reactivex.rxjava2:rxkotlin:$rxKotlinLibraryVersion"
implementation "io.reactivex.rxjava2:rxandroid:$rxAndroidLibraryVersion"
implementation "io.reactivex.rxjava2:rxjava:$rxJavaLibraryVersion"
implementation "com.squareup.retrofit2:retrofit:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:adapter-rxjava2:$retrofitLibraryVersion"
implementation "com.squareup.retrofit2:converter-moshi:$retrofitLibraryVersion"
implementation "com.squareup.moshi:moshi:$moshiLibraryVersion"
implementation "net.danlew:android.joda:$jodaTimeAndroidLibraryVersion"
implementation "com.jakewharton.timber:timber:$timberLibraryVersion"
// Google Library
implementation "com.google.android.material:material:$googleSupportLibraryVersion"
implementation "com.google.android.gms:play-services-maps:$googlePlayServiceLibraryVersion"
// AndroidX Google Library
implementation "androidx.room:room-runtime:$googleRoomLibraryVersion"
implementation "androidx.room:room-rxjava2:$googleRoomLibraryVersion"
implementation "androidx.appcompat:appcompat:$googleSupportLibraryVersion"
implementation "androidx.constraintlayout:constraintlayout:$googleContraintLayoutLibraryVersion"
kapt "androidx.room:room-compiler:$googleRoomLibraryVersion"
// Test Library
androidTestImplementation "com.google.code.findbugs:jsr305:$jsr305LibraryVersion"
testImplementation "junit:junit:$junitLibraryVersion"
testImplementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersion"
testImplementation "joda-time:joda-time:$jodaTimeAndroidLibraryVersion"
testImplementation "org.mockito:mockito-core:$mockitoLibraryVersion"
testImplementation "org.robolectric:robolectric:$robolectricLibraryVersion"
// AndroidX Test Library
androidTestImplementation("androidx.test.espresso:espresso-core:$espressoLibraryVersion", {
exclude group: "com.android.support", module: "support-annotations"
})
testImplementation "androidx.test:runner:$googleTestSupport"
testImplementation "androidx.test:rules:$googleTestSupport"
// Shared Test Library
testImplementation "com.squareup.okhttp3:mockwebserver:$okhttpLibraryVersion"
androidTestImplementation "com.squareup.okhttp3:mockwebserver:$okhttpLibraryVersion"
// Compile time plugin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
}