-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle.kts
81 lines (72 loc) · 2.45 KB
/
build.gradle.kts
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
import com.android.build.gradle.BaseExtension
import com.worker8.gradle.Secrets
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:${Versions.Tool.buildGradle}")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Versions.Tool.kotlin}")
}
}
allprojects {
repositories {
google()
jcenter()
}
}
subprojects {
if (name == "app") {
apply {
plugin("com.android.application")
}
} else {
apply {
plugin("com.android.library")
}
}
apply {
plugin("org.jetbrains.kotlin.android")
plugin("org.jetbrains.kotlin.kapt")
plugin("kotlin-android-extensions")
}
configure<BaseExtension> {
compileSdkVersion(Versions.AndroidConfig.sdkVersion)
defaultConfig {
minSdkVersion(Versions.AndroidConfig.minSdkVersion)
targetSdkVersion(Versions.AndroidConfig.sdkVersion)
versionCode = Versions.AndroidConfig.versionCode
versionName = Versions.AndroidConfig.versionName
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
all {
buildConfigField(
"String",
"FIXER_IO_ACCCES_KEY",
"\"${Secrets.fixerIOAccessToken}\""
)
}
debug {
buildConfigField("String", "CURRENCY_API_URL", "\"http://data.fixer.io/\"")
buildConfigField("String", "CURRENCY_API_URL_PATH", "\"api/latest\"")
}
release {
isMinifyEnabled = false
buildConfigField(
"String",
"CURRENCY_API_URL",
"\"https://simple-currency-backend.herokuapp.com/\""
)
buildConfigField("String", "CURRENCY_API_URL_PATH", "\"currency\"")
proguardFile(getDefaultProguardFile("proguard-android-optimize.txt"))
proguardFile(file("proguard-rules.pro"))
}
}
}
}
fun <T> NamedDomainObjectContainer<T>.release(configure: T.() -> Unit) =
getByName("release", configure)
fun <T> NamedDomainObjectContainer<T>.debug(configure: T.() -> Unit) = getByName("debug", configure)
fun <T> NamedDomainObjectContainer<T>.all(configure: T.() -> Unit) = getByName("all", configure)