-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle
202 lines (183 loc) · 9.65 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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
sdk = 29
minSdk = 21
kotlin_version = '1.3.72'
latest_helper = '72626c5db8'
dagger_version = '2.19'
support_version = '28.0.0'
arch_version = '1.1.1'
navigation_version = '1.0.0-alpha05'
paging_version = '1.0.1'
rx_binding_version = '2.1.1'
kotshi_version = '1.0.4'
moshi_version = '1.7.0'
room_version = '1.1.1'
glide_version = '4.4.0'
firebase_version = '16.0.4'
crashlytics_version = '2.9.5'
exo_player_version = '2.9.6'
libs = [
kotlin : "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version",
kotlin_reflect : "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version",
rx_helpers : "com.github.fuzz-productions:rx-helpers:${latest_helper}",
dagger : "com.google.dagger:dagger:${dagger_version}",
dagger_android : "com.google.dagger:dagger-android-support:${dagger_version}",
dagger_compiler : "com.google.dagger:dagger-compiler:${dagger_version}",
dagger_android_compiler : "com.google.dagger:dagger-android-processor:${dagger_version}",
rx : 'io.reactivex.rxjava2:rxjava:2.2.0',
rx_kotlin : 'io.reactivex.rxjava2:rxkotlin:2.3.0',
rx_android : 'io.reactivex.rxjava2:rxandroid:2.0.1',
arch_runtime : "android.arch.lifecycle:runtime:${arch_version}",
arch_extensions : "android.arch.lifecycle:extensions:${arch_version}",
arch_paging : "android.arch.paging:runtime:${paging_version}",
arch_common : "android.arch.paging:common:${arch_version}",
arch_navigation : "android.arch.navigation:navigation-fragment-ktx:${navigation_version}",
arch_navigation_ui : "android.arch.navigation:navigation-ui-ktx:${navigation_version}",
arch_rx : "android.arch.lifecycle:reactivestreams:${arch_version}",
retrofit : 'com.squareup.retrofit2:retrofit:2.3.0',
retrofit_rx : 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0',
retrofit_scalars : 'com.squareup.retrofit2:converter-scalars:2.1.0',
retrofit_moshi : 'com.squareup.retrofit2:converter-moshi:2.1.0',
retrofit_xml_converter : "com.squareup.retrofit2:converter-simplexml:2.3.0",
maps_utils : "com.google.maps.android:android-maps-utils:0.5",
moshi : "com.squareup.moshi:moshi:${moshi_version}",
moshi_kotlin_compiler : "com.squareup.moshi:moshi-kotlin-codegen:${moshi_version}",
moshi_kotlin : "com.squareup.moshi:moshi-kotlin:${moshi_version}",
room : "android.arch.persistence.room:runtime:${room_version}",
room_compiler : "android.arch.persistence.room:compiler:${room_version}",
room_rx : "android.arch.persistence.room:rxjava2:${room_version}",
timber : 'com.jakewharton.timber:timber:4.5.1',
threeten : 'com.jakewharton.threetenabp:threetenabp:1.1.1',
v4_support : "com.android.support:support-v4:${support_version}",
design_support : "com.android.support:design:${support_version}",
constraint_layout : "com.android.support.constraint:constraint-layout:2.0.0-alpha2",
glide : "com.github.bumptech.glide:glide:${glide_version}",
glide_compiler : "com.github.bumptech.glide:compiler:${glide_version}",
glide_okhttp_integration: "com.github.bumptech.glide:okhttp3-integration:${glide_version}@aar",
progress_interceptor : 'com.github.cliabhach:okhttp3-downloadprogress-interceptor:1.0.2-a1',
firebase_core : "com.google.firebase:firebase-core:${firebase_version}",
firebase_analytics : "com.google.firebase:firebase-analytics:${firebase_version}",
crashlytics : "com.crashlytics.sdk.android:crashlytics:${crashlytics_version}",
maps : "com.google.android.gms:play-services-maps:15.0.1",
location : "com.google.android.gms:play-services-location:15.0.1",
exo_player_core : "com.google.android.exoplayer:exoplayer-core:$exo_player_version",
exo_player_dash : "com.google.android.exoplayer:exoplayer-dash:$exo_player_version",
exo_player_ui : "com.google.android.exoplayer:exoplayer-ui:$exo_player_version",
exo_player_media_session: "com.google.android.exoplayer:extension-mediasession:$exo_player_version",
media_compat : "com.android.support:support-media-compat:${support_version}",
view_indicator : "com.github.fuzz-productions:CutoutViewIndicator:v0.8.2",
custom_tabs : "com.android.support:customtabs:${support_version}",
zxing_core : 'com.google.zxing:core:3.3.0'
]
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "android.arch.navigation:navigation-safe-args-gradle-plugin:$navigation_version"
classpath 'com.google.gms:google-services:4.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
subprojects {
configurations.all {
resolutionStrategy {
force libs.v4_support, libs.design_support, libs.media_compat
}
}
repositories {
google()
jcenter()
maven { url "https://www.jitpack.io" }
}
if (name == 'app') {
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
} else {
apply plugin: 'com.android.library'
}
apply plugin: 'kotlin-android'
// Most modules make use of the synthetic 'findViewById' accessors, part of
// the 'kotlin-android-extensions' plugin. The ':db' module goes beyond, as
// it also takes advantage of the experimental 'Parcelize' annotation.
//
// Any module that needs experimental features should enable such in the
// associated build.gradle, not here.
apply plugin: 'kotlin-android-extensions'
// FIXME: Minimize usage of the 'kapt' directive where possible
// (it can significantly slow down the build process)
apply plugin: 'kotlin-kapt'
android {
ext.envVariable = { String key, boolean isRelease ->
Properties properties = new Properties()
File localProperties = rootProject.file('local.properties')
File releaseProperties = rootProject.file('release.env')
File devProperties = rootProject.file('debug.env')
if (isRelease && releaseProperties.exists()) {
properties.load(releaseProperties.newDataInputStream())
return properties.getProperty(key)
} else if (!isRelease && devProperties.exists()) {
properties.load(devProperties.newDataInputStream())
return properties.getProperty(key)
} else if (localProperties.exists()) {
properties.load(localProperties.newDataInputStream())
return properties.getProperty(key)
} else {
return project.findProperty(key)
}
}
flavorDimensions "version"
productFlavors {
store {
dimension "version"
buildConfigField "boolean", "IS_RENTAL", "Boolean.parseBoolean(\"false\")"
}
rental {
dimension "version"
buildConfigField "boolean", "IS_RENTAL", "Boolean.parseBoolean(\"true\")"
}
}
compileSdkVersion sdk
defaultConfig {
minSdkVersion minSdk
targetSdkVersion sdk
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
test.java.srcDirs += 'src/test/kotlin'
}
// TODO: Re-enable 'translation' lint check when translated strings arrive
// TODO: Re-enable 'constraints' lint check whenever the IDE inspection actually agrees with the CLI tool
// TODO: Re-enable 'sibling' lint check once we've addressed all affected layouts
lintOptions {
disable 'MissingTranslation','MissingConstraints', 'NotSibling'
}
apply plugin: 'androidx.navigation.safeargs'
}
dependencies {
api libs.kotlin
}
kapt {
useBuildCache = true
mapDiagnosticLocations = true
correctErrorTypes = true
// Workaround for https://github.com/google/dagger/issues/1449
javacOptions {
option("-source", "8")
option("-target", "8")
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}