-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
115 lines (98 loc) · 4.46 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
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlinVersion = '1.3.21'
repositories {
jcenter()
google()
}
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
dependencies {
/*
* Android Plugin for Gradle - Version number and release notes
*
* - Stable: https://developer.android.com/studio/releases/gradle-plugin.html
* - Alpha: http://tools.android.com/tech-docs/new-build-system
*/
classpath 'com.android.tools.build:gradle:3.3.2'
// The kotlin-gradle-plugin compiles Kotlin sources and modules.
// https://kotlinlang.org/docs/reference/using-gradle.html
// https://github.com/JetBrains/kotlin/tree/master/libraries/tools/kotlin-gradle-plugin
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
// Google Services Plugin - Required for Firebase and related Google services
// https://developers.google.com/android/guides/google-services-plugin
// https://firebase.google.com/docs/android/setup
classpath 'com.google.gms:google-services:3.2.0'
// Generates dex count report - use `./gradlew assembleDebug`, reports @ ${buildDir}/outputs/dexcount/${variant}
// https://github.com/KeepSafe/dexcount-gradle-plugin
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
// Android plugin to support JacocoReport gradle task
// Use `./gradlew jacocoTestReport` to generate reports @ $buildDir/reports/jacoco
// https://github.com/arturdm/jacoco-android-gradle-plugin
// https://docs.gradle.org/current/dsl/org.gradle.testing.jacoco.tasks.JacocoReport.html
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.2'
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// Define versions in a single place
ext {
// Sdk and tools
// --------------------------------------------------
minSdkVersion = 21 // Lollipop 5.0
targetSdkVersion = 27 // Oreo MR1
compileSdkVersion = 27
// Android SDK Build Tools - Versions: https://developer.android.com/studio/releases/build-tools.html
buildToolsVersion = '27.0.3'
// Java Version Compatibility
javaSourceCompatibilityVersion = JavaVersion.VERSION_1_8
javaTargetCompatibilityVersion = JavaVersion.VERSION_1_8
// Google Products & Support library dependencies
// --------------------------------------------------
multiDexVersion = '1.0.2'
supportLibraryVersion = '27.0.2'
// https://developer.android.com/topic/libraries/support-library/revisions.html
firebaseVersion = '11.8.0' // https://firebase.google.com/docs/android/setup
// Unit test dependencies
// --------------------------------------------------
junitVersion = '4.12'
mockitoVersion = '1.10.19'
hamcrestVersion = '1.3'
espressoVersion = '2.2.2'
// 3rd party library dependencies
// --------------------------------------------------
daggerVersion = '2.14.1' // https://github.com/google/dagger
gsonVersion = '2.8.2' // https://github.com/google/gson/releases
retrofitVersion = '2.1.0' // https://github.com/square/retrofit/releases
rxJavaVersion = '1.2.7' // https://github.com/ReactiveX/RxJava/releases
rxAndroidVersion = '1.2.1' // https://github.com/ReactiveX/RxAndroid/releases
okHttpVersion = '3.3.1' // https://github.com/square/okhttp/releases
swaggerVersion = '1.5.9'
picassoVersion = '2.5.2' // https://github.com/square/picasso/releases
butterKnifeVersion = '8.8.1' // https://github.com/JakeWharton/butterknife/releases
jodaTimeVersion = '2.9.4'
glassfishJavaxAnnotationVersion = '10.0-b28'
timberLibraryVersion = '4.7.1' // https://github.com/JakeWharton/timber
leakcanaryLibraryVersion = '1.5.4' // https://github.com/square/leakcanary/releases
pkrssLibraryVersion = '1.2'
// NOTE: Use new version on https://github.com/Pkmmte/PkRSS/issues/31 is addressed.
}
//
// Utility methods
//
static def gitSha() {
return 'git rev-parse --short HEAD'.execute().text.trim()
}
static def buildTime() {
def df = new java.text.SimpleDateFormat("EEE, d MMM, yyyy hh:mm aaa z")
df.setTimeZone(TimeZone.getTimeZone("UTC"))
return df.format(new Date())
}